W3C

REC-CSS2-19980512Cascading Style Sheets, level 2 CSS2revision 1
CSS 2.1 Specification

W3C Recommendation 12-May-1998Working Draft 13 June 2005

This version:
http://www.w3.org/TR/1998/REC-CSS2-19980512http://www.w3.org/TR/2005/WD-CSS21-20050613
Latest version:
http://www.w3.org/TR/REC-CSS2http://www.w3.org/TR/CSS21
Previous version:
http://www.w3.org/TR/1998/PR-CSS2-19980324http://www.w3.org/TR/2004/CR-CSS21-20040225
Editors:
Bert Bos <>
Håkon Wium LieTantek Çelik <>
Chris LilleyIan Hickson <>
Ian JacobsHåkon Wium Lie <>

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.


Abstract

This specification defines Cascading Style Sheets, level 2 (CSS2). CSS2level 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, spacing,fonts and aural cues)spacing) to structured documents (e.g., HTML documents and XML applications). By separating the presentation style of documents from the content of documents, CSS2CSS 2.1 simplifies Web authoring and site maintenance.

CSS 2.1 builds on CSS2 [CSS2] which builds on CSS1 (see[CSS1] ) and, with very few exceptions, all valid CSS1 style sheets are valid CSS2 style sheets. CSS2. It 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. This specificationIt also supports content positioning, downloadable fonts,table layout, features for internationalization, automatic counters and numbering,internationalization and some properties related to user interface.

StatusCSS 2.1 corrects a few errors in CSS2 (the most important being a new definition of this document This document has been reviewed by W3C Membersthe height/width of absolutely positioned elements, more influence for HTML's "style" attribute and other interested partiesa new calculation of the 'clip' property), and hasadds a few highly requested features which have already been endorsed by the Director aswidely implemented. But most of all CSS 2.1 represents a W3C Recommendation."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 a stable documentderived 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 as reference material or cited as a normative reference from another document. W3C's rolein makinga future CSS3 specification. Implementations may refer to CSS2 for the Recommendationdefinitions of features that have been removed, but for other features CSS 2.1 is to draw attention tothe specification and to promote its widespread deployment.normative reference.

Status of this enhancesdocument

This section describes the functionality and interoperabilitystatus of this document at the Web.time of its publication. Other documents may supersede it. A list of current W3C Recommendationspublications and otherthe latest revision of this technical documentsreport can be found in the W3C technical reports index at http://www.w3.org/TRhttp://www.w3.org/TR/.

This is a "Last Call" Working Draft. The deadline for comments is 15 July 2005.

The (archived) public mailing list www-style@w3.org (see instructions) is preferred for discussion of CSS features takes placethis and other specifications in the Style area. When commenting on www-style@w3.org . Available formatsthis document, please put the CSS2 specification is availabletext "CSS21" in the following formats: HTML: http://www.w3.org/TR/1998/REC-CSS2-19980512 a plain text file: http://www.w3.org/TR/1998/REC-CSS2-19980512/css2.txt , HTMLsubject, preferably like this: "[CSS21] <summary of comment>"

Publication as a gzip'ed tar file: http://www.w3.org/TR/1998/REC-CSS2-19980512/css2.tgz , HTML as a zip file (this is a '.zip' fileWorking Draft does not an '.exe'): http://www.w3.org/TR/1998/REC-CSS2-19980512/css2.zip , as wellimply endorsement by the W3C Membership. It is inappropriate to cite this document as other than work in progress.

A gzip'ed PostScript file: http://www.w3.org/TR/1998/REC-CSS2-19980512/css2.ps.gz ,test suite and a PDF file: http://www.w3.org/TR/1998/REC-CSS2-19980512/css2.pdf . In case of a discrepancy between the various forms ofreport on implementations will be provided before the specification, http://www.w3.org/TR/1998/REC-CSS2-19980512document becomes a Proposed Recommendation.

This document is considered the definitive version. Available languagesproduced by the English versionCSS working group (part of this specification isthe only normative version. However, for translations in other languagesStyle Activity, see http://www.w3.org/Style/css2-updates/translations.htmlsummary).

This document was produced under the 24 January 2002 CPP as amended by the W3C Patent Policy Transition Procedure. ErrataThe Working Group maintains a public list of known errors inpatent disclosures relevant to this document; 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) with respect to this specification is available at http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html . Please report errorsshould disclose the information in this document to css2-editors@w3.org . Quick Tableaccordance with section 6 of Contents 1 Aboutthe CSS2W3C Patent Policy.

Candidate Recommendation Exit Criteria

For this specification 2 Introductionto CSS2 3 Conformance: Requirements and Recommendations 4 CSS2 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 19 Aural style sheets Appendix A. A sample style sheetexit the CR stage, the following conditions must be met:

  1. There must be at least two interoperable implementations for HTML 4.0 Appendix B. Changes from CSS1 Appendix C. Implementation and performance notesevery feature. For fonts Appendix D.the grammarpurposes of CSS2 Appendix E. References Appendix F. Property index Appendix G. Descriptor index Appendix H. Index Full Tablethis criterion, we define the following terms:

    feature

    A section or subsection of Contents 1 Aboutthe CSS2 Specification 1.1 Readingspecification.

    interoperable

    passing the specification 1.2 Howrespective test cases in the specificationtest suite, or, if the implementation is organized 1.3 Conventions 1.3.1 Document language elements and attributes 1.3.2 CSS property definitions Value Initial Applies to Inheritednot a web browser, equivalent tests. Every relevant test in the test suite should have an equivalent test created if such a UA is to be used to claim interoperability. In addition if such a UA is to be used to claim interoperability, then there must one or more additional UAs which can also pass those equivalent tests in the same way for the purpose of interoperability. The equivalent tests must be made publicly available for the purposes of peer review.

    implementation

    a user agent which:

    1. implements the feature.
    2. is available (i.e. publicly downloadable or available through some other public point of sale mechanism). This is the "show me" requirement.
    3. is shipping (i.e. development, private or unofficial versions are insufficient).
    4. is not experimental (i.e. is intended for a wide audience and could be used on a daily basis).
  2. A minimum of six months of the CR period must have elapsed. This is to ensure that enough time is given for any remaining major errors to be caught.

  3. The CR period will be extended if implementations are slow to appear.

  4. Features that were not in CSS1 will be dropped (thus reducing the list of "all" features mentioned above) if two or more interoperable implementations of those features are not found by the end of the CR period.

  5. Features will also be dropped if sufficient and adequate tests (by judgment of the working group) have not been produced for those features by the end of the CR period.

Features at risk

The working group has identified the following features as being currently poorly implemented by UAs. They are therefore most at risk of being removed from CSS 2.1 when exiting CR. (Any changes of this nature will still result in the specification being returned to last call.) Implementors are urged to implement these features, or correct bugs in their implementations, if they wish to see thsse features remain in this specification.

New 'list-style-type' values

Implementors should look at CSS3 Lists instead, where these and many other new values not found in CSS1 are defined in detail. [CSS3LIST]

Support for multiple ID attributes for the ID selector

Because implementations are not expected to support multiple IDs per element soon, this feature may be made informative. The W3C Selectors specification will continue to have this feature normatively. (Section 5.8.4.)

Automatic table layout algorithm

The input to the suggested (non-normative) automatic layout algorithm for tables is restricted to (1) the containing block width and (2) the content and properties of the table and its children. This restriction may be lifted.

Quotes

The 'quotes' property and the 'open-quote', 'close-quote', 'no-open-quote' and 'no-close-quote' keywords may be dropped.

Quick Table of Contents

Full Table of Contents