CARVIEW |
Cascading Style Sheets Level 2 Revision 2 (CSS 2.2) Specification
W3C First Public Working Draft 12 April 2016
- This version:
- https://www.w3.org/TR/2016/WD-CSS22-20160412/
- Latest version:
- https://www.w3.org/TR/CSS22/
- Latest CSS level 2:
- https://www.w3.org/TR/CSS2/
- Latest CSS:
- https://www.w3.org/TR/CSS/
- Editors' draft:
- https://dev.w3.org/csswg/css2/
- Editors:
- Bert Bos <bert @w3.org>
- Former editors:
- Tantek Çelik <tantek @cs.stanford.edu>
- Ian Hickson <ian @hixie.ch>
- Håkon Wium Lie <howcome @opera.com>
- Chris Lilley <chris @w3.org>
- Ian Jacobs <ij @w3.org
This document is also available in these non-normative formats: plain text, gzip'ed tar file, zip file, gzip'ed PostScript, PDF. See also translations.
Copyright © 2016 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and document use rules apply.
Abstract
This specification defines Cascading Style Sheets level 2. CSS is a style sheet language that allows authors and users to attach style (e.g., fonts and spacing) to structured documents (e.g., HTML documents and XML applications). By separating the presentation style of documents from the content of documents, CSS simplifies Web authoring and site maintenance.
CSS 2.2 is the second revision of CSS level 2 [CSS2]. It corrects a few errors in CSS 2.1, the first revision of CSS level 2. It is not the latest version of CSS. See the "CSS Snapshot" [CSS] for an overview of specifications that make up the whole of CSS.
CSS level 2 supports media-specific style sheets so that authors may tailor the presentation of their documents to visual browsers, aural devices, printers, braille devices, handheld devices, etc. It also supports content positioning, table layout, features for internationalization and some properties related to user interface.
Status of this document
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
Publication as a First Public Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by the CSS Working Group (part of the Style Activity).
The (archived) public mailing list www-style@w3.org (see instructions) is preferred for discussion of this specification. When sending e-mail, please put the text “CSS22” in the subject, preferably like this: “[CSS22] …summary of comment…”
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This document is governed by the 1 September 2015 W3C Process Document.
All changes since the previous Recommendation are listed in appendix C.
Table of Contents
- 1 About the CSS 2.2 Specification
- 2 Introduction to CSS 2.2
- 3 Conformance: Requirements and Recommendations
- 4 Syntax and basic data types
- 5 Selectors
- 6 Assigning property values, Cascading, and Inheritance
- 7 Media types
- 8 Box model
- 9 Visual formatting model
- 10 Visual formatting model details
- 11 Visual effects
- 12 Generated content, automatic numbering, and lists
- 13 Paged media
- 14 Colors and Backgrounds
- 15 Fonts
- 16 Text
- 17 Tables
- 18 User interface
- Appendix A. Aural style sheets
- Appendix B. Bibliography
- Appendix C. Changes
- Appendix D. Default style sheet for HTML 4
- Appendix E. Elaborate description of Stacking Contexts
- Appendix F. Full property table
- Appendix G. Grammar of CSS 2.2
- Appendix I. Index
Full Table of Contents
- 1 About the CSS 2.2 Specification
- 2 Introduction to CSS 2.2
- 3 Conformance: Requirements and Recommendations
- 4 Syntax and basic data types
- 5 Selectors
- 6 Assigning property values, Cascading, and Inheritance
- 7 Media types
- 8 Box model
- 8.1 Box dimensions
- 8.2 Example of margins, padding, and borders
- 8.3 Margin properties: 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', and 'margin'
- 8.4 Padding properties: 'padding-top', 'padding-right', 'padding-bottom', 'padding-left', and 'padding'
- 8.5 Border properties
- 8.5.1 Border width: 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width', and 'border-width'
- 8.5.2 Border color: 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color', and 'border-color'
- 8.5.3 Border style: 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style', and 'border-style'
- 8.5.4 Border shorthand properties: 'border-top', 'border-right', 'border-bottom', 'border-left', and 'border'
- 8.6 The box model for inline elements in bidirectional context
- 9 Visual formatting model
- 9.1 Introduction to the visual formatting model
- 9.2 Controlling box generation
- 9.3 Positioning schemes
- 9.4 Normal flow
- 9.5 Floats
- 9.6 Absolute positioning
- 9.7 Relationships between 'display', 'position', and 'float'
- 9.8 Comparison of normal flow, floats, and absolute positioning
- 9.9 Layered presentation
- 9.10 Text direction: the 'direction' and 'unicode-bidi' properties
- 10 Visual formatting model details
- 10.1 Definition of "containing block"
- 10.2 Content width: the 'width' property
- 10.3 Calculating widths and margins
- 10.3.1 Inline, non-replaced elements
- 10.3.2 Inline, replaced elements
- 10.3.3 Block-level, non-replaced elements in normal flow
- 10.3.4 Block-level, replaced elements in normal flow
- 10.3.5 Floating, non-replaced elements
- 10.3.6 Floating, replaced elements
- 10.3.7 Absolutely positioned, non-replaced elements
- 10.3.8 Absolutely positioned, replaced elements
- 10.3.9 'Inline-block', non-replaced elements in normal flow
- 10.3.10 'Inline-block', replaced elements in normal flow
- 10.4 Minimum and maximum widths: 'min-width' and 'max-width'
- 10.5 Content height: the 'height' property
- 10.6 Calculating heights and margins
- 10.6.1 Inline, non-replaced elements
- 10.6.2 Inline replaced elements, block-level replaced elements in normal flow, 'inline-block' replaced elements in normal flow and floating replaced elements
- 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
- 10.6.4 Absolutely positioned, non-replaced elements
- 10.6.5 Absolutely positioned, replaced elements
- 10.6.6 Complicated cases
- 10.6.7 'Auto' heights for block formatting context roots
- 10.7 Minimum and maximum heights: 'min-height' and 'max-height'
- 10.8 Line height calculations: the 'line-height' and 'vertical-align' properties
- 11 Visual effects
- 12 Generated content, automatic numbering, and lists
- 13 Paged media
- 14 Colors and Backgrounds
- 15 Fonts
- 15.1 Introduction
- 15.2 Font matching algorithm
- 15.3 Font family: the 'font-family' property
- 15.4 Font styling: the 'font-style' property
- 15.5 Small-caps: the 'font-variant' property
- 15.6 Font boldness: the 'font-weight' property
- 15.7 Font size: the 'font-size' property
- 15.8 Shorthand font property: the 'font' property
- 16 Text
- 17 Tables
- 18 User interface
- Appendix A. Aural style sheets
- A.1 The media types 'aural' and 'speech'
- A.2 Introduction to aural style sheets
- A.3 Volume properties: 'volume'
- A.4 Speaking properties: 'speak'
- A.5 Pause properties: 'pause-before', 'pause-after', and 'pause'
- A.6 Cue properties: 'cue-before', 'cue-after', and 'cue'
- A.7 Mixing properties: 'play-during'
- A.8 Spatial properties: 'azimuth' and 'elevation'
- A.9 Voice characteristic properties: 'speech-rate', 'voice-family', 'pitch', 'pitch-range', 'stress', and 'richness'
- A.10 Speech properties: 'speak-punctuation' and 'speak-numeral'
- A.11 Audio rendering of tables
- A.12 Sample style sheet for HTML
- A.13 Emacspeak
- Appendix B. Bibliography
- Appendix C. Changes
- Appendix D. Default style sheet for HTML 4
- Appendix E. Elaborate description of Stacking Contexts
- Appendix F. Full property table
- Appendix G. Grammar of CSS 2.2
- Appendix I. Index