Cascading Style Sheets Level 2 Revision 1 †CSS€2.1‡ Specification

Cascading Style Sheets Level 2 Revision 1 †CSS€2.1‡ Specification

Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification [p. ??] Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification W3C Proposed Recommendation 12 April 2011 This version: http://www.w3.org/TR/2011/PR-CSS2-20110412 [p. ??] Latest version: http://www.w3.org/TR/CSS2 [p. ??] Previous versions: http://www.w3.org/TR/2010/WD-CSS2-20101207 [p. ??] http://www.w3.org/TR/2008/REC-CSS2-20080411/ [p. ??] Editors: Bert Bos [p. ??] <bert @w3.org> Tantek Çelik [p. ??] <tantek @cs.stanford.edu> Ian Hickson [p. ??] <ian @hixie.ch> Håkon Wium Lie [p. ??] <howcome @opera.com> Please refer to the errata [p. ??] for this document. This document is also available in these non-normative formats: plain text [p. ??] , gzip’ed tar file [p. ??] , zip file [p. ??] , gzip’ed PostScript [p. ??] , PDF [p. ??] . See also translations [p. ??] . Copyright [p. ??] © 2011 World Wide Web ConsortiumW3C [p. ??] ® (Massachusetts Institute of TechnologyMIT [p. ??] , European Research Consortium for Informatics and MathematicsERCIM [p. ??] , Keio [p. ??] ), All Rights Reserved. W3C liability [p. ??] , trademark [p. ??] and document use [p. ??] rules apply. Abstract This specification defines Cascading Style Sheets, level 2 revision 1 (CSS 2.1). CSS 2.1 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 appli- cations). By separating the presentation style of documents from the content of documents, CSS 2.1 simplifies Web authoring and site maintenance. CSS 2.1 builds on CSS2 [CSS2] which builds on CSS1 [CSS1]. It supports media-specific style sheets so that authors may tailor the presentation of their docu- ments to visual browsers, aural devices, printers, braille devices, handheld devices, etc. It also supports content positioning, table layout, features for internationalization 15 Apr 2011 21:19 1 Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification and some properties related to user interface. CSS 2.1 corrects a few errors in CSS2 (the most important being a new definition of the height/width of absolutely positioned elements, more influence for HTML’s "style" attribute and a new calculation of the ’clip’ property), and adds a few highly requested features which have already been widely implemented. But most of all CSS 2.1 represents a "snapshot" of CSS usage: it consists of all CSS features that are implemented interoperably at the date of publication of the Recommendation. CSS 2.1 is derived from and is intended to replace CSS2. Some parts of CSS2 are unchanged in CSS 2.1, some parts have been altered, and some parts removed. The removed portions may be used in a future CSS3 specification. Future specs should refer to CSS 2.1 (unless they need features from CSS2 which have been dropped in CSS 2.1, and then they should only reference CSS2 for those features, or preferably reference such feature(s) in the respective CSS3 Module that includes those feature(s)). 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 http://www.w3.org/TR/. [p. ??] Publication as a Proposed Recommendation does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obso- leted by other documents at any time. It is inappropriate to cite this document as other than work in progress. Advisory Committee representatives are requested to review the document and fill the online form [p. ??] before 17 May 2011. The (archived [p. ??] ) public mailing list [email protected] [p. ??] (see instruc- tions [p. ??] ) is preferred for discussion of this specification. When sending e-mail, please put the text “CSS21” in the subject, preferably like this: “[CSS21] ¼summary of comment¼” This document was produced by the CSS Working Group [p. ??] (part of the Style Activity [p. ??] ). This document was produced by a group operating under the 5 February 2004 W3C Patent Policy [p. ??] . W3C maintains a public list of any patent disclosures [p. ??] 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) [p. ??] must disclose the information in accordance with section 6 of the W3C Patent Policy [p. ??] . The Working Group has created a test suite [p. ??] and an implementation report. [p. ??] 2 15 Apr 2011 21:19 Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification All changes since the previous Working Draft, the previous Candidate Recommen- dation and the previous Recommendation are listed in appendix C. [p. 329] 15 Apr 2011 21:19 3 Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification Quick Table of Contents 1 About the CSS 2.1 Specification . 27. 2 Introduction to CSS 2.1 . 35. 3 Conformance: Requirements and Recommendations .. 43. 4 Syntax and basic data types . 49. 5 Selectors . 77. 6 Assigning property values, Cascading, and Inheritance .. 99. 7 Media types . 107. 8 Box model . 111. 9 Visual formatting model . 127. 10 Visual formatting model details . 171. 11 Visual effects . 195. 12 Generated content, automatic numbering, and lists .. 203. 13 Paged media . 223. 14 Colors and Backgrounds . 233. 15 Fonts . 241. 16 Text . 257. 17 Tables . 269. 18 User interface . 297. Appendix A. Aural style sheets . 305. Appendix B. Bibliography . 325. Appendix C. Changes . 329. Appendix D. Default style sheet for HTML 4 .. 453. Appendix E. Elaborate description of Stacking Contexts .. 455. Appendix F. Full property table . 459. Appendix G. Grammar of CSS 2.1 . 467. Appendix I. Index . 475. 4 15 Apr 2011 21:19 Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification Full Table of Contents 1 About the CSS 2.1 Specification . 27. 1.1 CSS 2.1 vs CSS 2 . 27. 1.2 Reading the specification . 28. 1.3 How the specification is organized .. 28. 1.4 Conventions . 29. 1.4.1 Document language elements and attributes .. 29. 1.4.2 CSS property definitions .. 29. 1.4.2.1 Value . 29. 1.4.2.2 Initial . 31. 1.4.2.3 Applies to . 31. 1.4.2.4 Inherited . 31. 1.4.2.5 Percentage values .. 31. 1.4.2.6 Media groups . 31. 1.4.2.7 Computed value .. 32. 1.4.3 Shorthand properties . 32. 1.4.4 Notes and examples . 32. 1.4.5 Images and long descriptions .. 33. 1.5 Acknowledgments . 33. 2 Introduction to CSS 2.1 . 35. 2.1 A brief CSS 2.1 tutorial for HTML .. 35. 2.2 A brief CSS 2.1 tutorial for XML .. 38. 2.3 The CSS 2.1 processing model .. 39. 2.3.1 The canvas . 40. 2.3.2 CSS 2.1 addressing model .. 40. 2.4 CSS design principles . 41. 3 Conformance: Requirements and Recommendations .. 43. 3.1 Definitions . 43. 3.2 UA Conformance . 47. 3.3 Error conditions . 48. 3.4 The text/css content type . 48. 4 Syntax and basic data types . 49. 4.1 Syntax . 49. 4.1.1 Tokenization . 50. 4.1.2 Keywords . 53. 4.1.2.1 Vendor-specific extensions .. 54. 4.1.2.2 Informative Historical Notes .. 54. 4.1.3 Characters and case . 55. 4.1.4 Statements . 56. 4.1.5 At-rules . 57. 4.1.6 Blocks . 57. 4.1.7 Rule sets, declaration blocks, and selectors .. 58. 15 Apr 2011 21:19 5 Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification 4.1.8 Declarations and properties .. 59. 4.1.9 Comments . 60. 4.2 Rules for handling parsing errors .. 60. 4.3 Values . 63. 4.3.1 Integers and real numbers .. 63. 4.3.2 Lengths . 63. 4.3.3 Percentages . 67. 4.3.4 URLs and URIs . 67. 4.3.5 Counters . 68. 4.3.6 Colors . 69. 4.3.7 Strings . 70. 4.3.8 Unsupported Values . 71. 4.4 CSS style sheet representation .. 71. 4.4.1 Referring to characters not represented in a character encoding75 5 Selectors . 77. 5.1 Pattern matching . 77. 5.2 Selector syntax . 79. 5.2.1 Grouping . 79. 5.3 Universal selector . 80. 5.4 Type selectors . 80. 5.5 Descendant selectors . 80. 5.6 Child selectors . 81. 5.7 Adjacent sibling selectors . 81. 5.8 Attribute selectors . 82. 5.8.1 Matching attributes and attribute values .. 82. 5.8.2 Default attribute values in DTDs .. 84. 5.8.3 Class selectors . 85. 5.9 ID selectors . 86. 5.10 Pseudo-elements and pseudo-classes .. 87. 5.11 Pseudo-classes . 88. 5.11.1 :first-child pseudo-class .. 88. 5.11.2 The link pseudo-classes: :link and :visited .. 89. 5.11.3 The dynamic pseudo-classes: :hover, :active, and :focus . 89. 5.11.4 The language pseudo-class: :lang .. 91. 5.12 Pseudo-elements . 92. 5.12.1 The :first-line pseudo-element .. 92. 5.12.2 The :first-letter pseudo-element .. 94. 5.12.3 The :before and :after pseudo-elements .. 97. 6 Assigning property values, Cascading, and Inheritance .. 99. 6.1 Specified, computed, and actual values .. 99. 6.1.1 Specified values . 99. 6.1.2 Computed values . 100. 6.1.3 Used values . 100. 6 15 Apr 2011 21:19 Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification 6.1.4 Actual values . 100. 6.2 Inheritance . 100. 6.2.1 The ’inherit’ value . 101. 6.3 The @import rule .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    487 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us