This specification has been written with two types of readers in mind: CSS authors and CSS implementors. We hope the specification will provide authors with the tools they need to write efficient, attractive, and accessible documents, without overexposing them to CSS's implementation details. Implementors, however, should find all they need to build conforming user agents. The specification begins with a general presentation of CSS and becomes more and more technical and specific towards the end. For quick access to information, a general table of contents, specific tables of contents at the beginning of each section, and an index provide easy navigation, in both the electronic and printed versions.
The specification has been written with two modes of presentation in mind: electronic and printed. Although the two presentations will no doubt be similar, readers will find some differences. For example, links will not work in the printed version (obviously), and page numbers will not appear in the electronic version. In case of a discrepancy, the electronic version is considered the authoritative version of the document.
The specification is organized into the following sections:
Each CSS property definition begins with a summary of key information that resembles the following:
'Property-name'
| Value: | Possible constant values or value types |
|---|---|
| Initial: | The initial value |
| Applies to: | Elements this property applies to |
| Inherited: | Whether the property is inherited |
| Percentage values: | How percentage values should be interpreted |
The five categories have the following meanings:
Values may be arranged as follows:
Juxtaposition is stronger than the double bar, and the double bar is stronger than the bar.
Thus, a b | c || d e is equivalent to [ a b ] | [ c || [ d e ]].
Every type, keyword, or bracketed group may be followed by one of the following modifiers:
The following examples illustrate different value types:
Value: N | NW | NE
Value: [ <length> | thick | thin ]{1,4}
Value: [<family-name> , ]* <family-name>
Value: <url>? <color> [ / <color> ]?
Value: <url> || <color>
Some properties are shorthand rules that allow authors to specify the values of several properties with a single property.
For instance, the 'font' property is a shorthand property for setting 'font-style', 'font-variant', 'font-weight', 'font-size', 'line-height', and 'font-family' all at once.
When values are omitted from a shorthand form, each "missing" property either inherits its value or is assigned its initial value (see the section on the cascade).
The multiple style rules of the previous example:
H1 {
font-weight: bold;
font-size: 12pt;
line-height: 14pt;
font-family: Helvetica;
font-variant: normal;
font-style: normal;
}
may be rewritten with a single shorthand property:
H1 { font: bold 12pt/14pt Helvetica }
In this example, 'font-variant' and 'font-style' have been omitted from the shorthand form, so they must be assigned either an inherited or initial value.
Informative notes are emphasized to stand out from surrounding text and may be rendered specially by some user agents.
All examples illustrating deprecated usage are marked as "DEPRECATED EXAMPLE". Deprecated examples also include recommended alternate solutions. All examples that illustrates illegal usage are clearly marked as "ILLEGAL EXAMPLE".
Examples and notes are marked within the source HTML for the specification and some user agents may render them specially.
This specification is the product of the W3C Working Group on Cascading Style Sheets and Formatting Properties. In addition to the editors of this specification, the members of the Working Group are: Brad Chase (Bitstream), Chris Wilson (Microsoft), Daniel Glazman (Electricité de France), Dave Raggett (W3C/HP), Ed Tecot (Microsoft), Jared Sorensen (Novell), Lauren Wood (SoftQuad), Laurie Anna Kaplan (Microsoft), Mike Wexler (Adobe), Murray Maloney (Grif), Powell Smith (IBM), Robert Stevahn (HP), Steve Byrne (JavaSoft), Steven Pemberton (CWI), and Thom Phillabaum (Netscape). We thank them for their continued efforts.
A number of invited experts to the Working Group have contributed: George Kersher, Glenn Rippel (Bitstream), Jeff Veen (HotWired), Markku T. Hakkinen (The Productivity Works), Martin Dürst (Universität Zürich), Roy Platon (RAL), Todd Fahrner (Verso) and Vincent Quint (W3C).
The section on Web Fonts was strongly shaped by Brad Chase (Bitstream) David Meltzer (Microsoft Typography) and Steve Zilles (Adobe). The following people have also contributed in various ways to the section pertaining to fonts: Alex Beamon (Apple), Ashok Saxena (Adobe), Ben Bauermeister (HP), Dave Raggett (W3C/HP), David Opstad (Apple), David Goldsmith (Apple), Ed Tecot (Microsoft), Erik van Blokland (LettError), François Yergeau (Alis), Gavin Nicol (Inso), Herbert van Zijl (Elsevier), Liam Quin, Misha Wolf (Reuters), Paul Haeberli (SGI), and the late Phil Karlton (Netscape).
The section on Paged Media was in large parts authored by Robert Stevahn (HP) and Stephen Waters (Microsoft).
Robert Stevahn (HP), along with Scott Furman (Netscape) and Scott Isaacs (Microsoft) were key contributors to CSS Positioning.
Mike Wexler (Adobe) was the editor of the interim Working Draft which described many of the new features of CSS2.
T.V.Raman (Adobe) made pivotal contributions towards Aural Cascading Style Sheets and the concepts of aural presentation.
Todd Fahrner (Verso) researched contemporary and historical browsers to develop the sample style sheet in the appendix.
Through electronic and physical encounters, the following people have contributed to the development of CSS2: James Clark, Dan Connolly, Douglas Rand, Sho Kuwamoto, Donna Converse, Scott Isaacs, Lou Montulli, Henrik Frystyk Nielsen, Jacob Nielsen, Vincent Mallet, Philippe Le Hegaret, William Perry, David Siegel, Al Gilman, Jason White, Daniel Dardailler.
The discussions on www-style@w3.org have been influential in many key issues for CSS. Especially, we would like to thank Bjorn Backlund, Todd Fahrner, MegaZone, Eric Meyer, David Perrell, Liam Quinn, Chris Wilson, Neil St.Laurent and Andrew Marshall for their participation.
Special thanks to Arnaud Le Hors, whose engineering contributions made this document work.
Lastly, thanks to Tim Berners-Lee without whom none of this would have been possible.