Cascading Style Sheets Level 2 Revision 2 (CSS 2.2) Specification W3C First Public Working Draft 12 April 2016
Total Page:16
File Type:pdf, Size:1020Kb
Cascading Style Sheets Level 2 Revision 2 (CSS 2.2) Specification W3C First Public Working Draft 12 April 2016 This version: http://www.w3.org/TR/2016/WD-CSS22-20160412/ Latest version: http://www.w3.org/TR/CSS22/ Latest CSS level 2: http://www.w3.org/TR/CSS2/ Latest CSS: http://www.w3.org/TR/CSS/ Editors' draft: http://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 p.0, gzip'ed tar file p.0, ZIP FILEp.0, gzip'ed PostScript p.0, PDFp.0. 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 au- thors 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]p.363. 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]p.363 for an overview of specifications that make up the whole of CSS. – 1 – – Cascading Style Sheets Level 2 Revision 2 (CSS 2.2) Specification – CSS level 2 supports media-specific style sheets so that authors may tailor the presentation of their doc- uments 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 inter- face. Status of this document This section describes the status of this document at the time of its publication. Other documents may su- persede 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 http://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 inap- propriate 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 [email protected] (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 knowl- edge 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.p.367 Table of Contents 1 About the CSS 2.2 Specification. 17 2 Introduction to CSS 2.2. 25 3 Conformance: Requirements and Recommendations . 35 4 Syntax and basic data types . 43 5 Selectors . 71 6 Assigning property values, Cascading, and Inheritance . 97 7 Media types . 107 8 Box model. 113 – 2 – – Cascading Style Sheets Level 2 Revision 2 (CSS 2.2) Specification – 9 Visual formatting model . 133 10 Visual formatting model details . 183 11 Visual effects . 209 12 Generated content, automatic numbering, and lists . 221 13 Paged media . 245 14 Colors and Backgrounds. 255 15 Fonts . 265 16 Text . 281 17 Tables . 295 18 User interface. 327 Appendix A. Aural style sheets . 335 Appendix B. Bibliography . 361 Appendix C. Changes. 367 Appendix D. Default style sheet for HTML 4 . 381 Appendix E. Elaborate description of Stacking Contexts . 385 Appendix F. Full property table . 391 Appendix G. Grammar of CSS 2.2 . 407 Appendix I. Index. 415 Full Table of Contents 1 About the CSS 2.2 Specification. 17 1.1 CSS 2.2 vs CSS 2 . 17 1.2 Reading the specification . 18 1.3 How the specification is organized . 19 1.4 Conventions . 19 1.4.1 Document language elements and attributes . 19 – 3 – – Cascading Style Sheets Level 2 Revision 2 (CSS 2.2) Specification – 1.4.2 CSS property definitions . 19 1.4.2.1 Value . 20 1.4.2.2 Initial . 22 1.4.2.3 Applies to . 22 1.4.2.4 Inherited . 22 1.4.2.5 Percentage values . 22 1.4.2.6 Media groups . 22 1.4.2.7 Computed value . 22 1.4.3 Shorthand properties. 22 1.4.4 Notes and examples . 23 1.4.5 Images and long descriptions . 23 1.5 Acknowledgments . 23 2 Introduction to CSS 2.2. 25 2.1 A brief CSS 2.2 tutorial for HTML . 25 2.2 A brief CSS 2.2 tutorial for XML . 28 2.3 The CSS 2.2 processing model. ..