Contents
This appendix is informative, not normative.
CSS 2.1 is an updated revision of CSS2. The changes between the CSS2 specification (see [CSS2]) and this specification fall into five groups: known errors, typographical errors, clarifications, changes and additions. Typographical errors are not listed here.
In addition, this chapter lists the errata that were subsequently applied to CSS 2.1 since it became a Candidate Recommendation in July 2007.
This chapter is not a complete list of changes. Minor editorial changes and most changes to examples are also not listed here.
New color value: 'orange'
New 'display' value: 'inline-block'
New 'content' values 'none' and 'normal'. (The values 'none' and 'normal' are equivalent in CSS 2.1, but may have different functions in CSS3.)
New 'white-space' values: 'pre-wrap' and 'pre-line'
New 'cursor' value: 'progress'
This new section is added to explain the motivation for CSS2.1 and its relation to CSS2.
This section (formerly Section 1.1) has been marked non-normative.
This section (formerly Section 1.2) has been marked non-normative.
This section (formerly unnumbered under 1.3.2) notes that value types are specified in terms of tokens and that spaces may appear between tokens in values. A note explains that spaces are required between some tokens.
This section (formerly unnumbered under 1.3.2) now declares the Media line in property definitions to be non-normative.
A new line is added to each property definition specifying what the computed values are for the property. (This defines what level of computation is done to a property value before inheritance and before certain other calculations.)
This section (formerly 1.3.4) now specifies that HTML examples lacking DOCTYPE declarations are SGML Text Entities conforming to the HTML 4.01 Strict DTD [HTML4]. The markup for many examples has been reformulated to either include a DOCTYPE or conform to this definition.
This section (formerly 1.4) has been updated to reflect contributions to CSS2.1 and has been marked non-normative.
Support for user style sheets is now required (in most cases), rather than just recommended.
Support for turning of author style sheets is now required.
Application of CSS properties to form controls is explicitly undefined. Authors are recommended to treat form control styling capabilities in UAs as experimental.
This section changed to say that error handling is specified in most cases.
Added INVALID token and rules for its definition.
An optional hyphen, "-", is now allowed at the beginning of an "ident" for vendor extensions. (See section 4.1.2.1)
The underscore character ("_") is allowed in identifiers. The definitions of the lexical macros "nmstart" and "nmchar" now include it. See also section 4.1.2.1 (Vendor extensions).
The "escape" macro has been modified to allow the escaping of any character except newlines, form feeds, and hex digits (to avoid conflict with unicode escapes).
Modified "string1" and "string2" macros by defining allowed characters through excluding disallowed characters. This allows invisible ASCII characters to be included in a string.
Updated prose about identifiers (second bullet point) to match changes in the tokenization (above).
Excluded null (0x0) character from CSS numerical escapes and indicate that it is undefined in CSS2.1 what happens if such a character is encountered.
Allowed the use of U+FFFD as a replacement for characters outside the range allowed by Unicode.
CSS is no longer case-insensitive, but case-sensitive with exceptions. Changed "All CSS style sheets are case-insensitive, except for parts that are not under the control of CSS" to "All CSS syntax is case-insensitive within the ASCII range (i.e. [a-z] and [A-Z] are equivalent), except for parts that are not under the control of CSS." See also the change to case-sensitivity of counters in 4.3.5.
Defined parsing in the cases of Malformed Declarations, Unexpected End of Stylesheet, and Unexpected End of String.
Sections 4.3.7 (Angles), 4.3.8 (Times), and 4.3.9 (Frequencies) have been moved to the informative Appendix A.
Added a paragraph on heuristics for finding the x-height of a font.
Updated URI references to RFC3986.
Changed "Counters are denoted by identifiers" to "ounters are denoted by case-sensitive identifiers" (see also the change to case-sensitivity in 4.1.3).
Defined the numeric values corresponding to color keywords instead of referencing HTML4 for those values.
UAs are now allowed to intelligently map colors outside the gamut into the gamut instead of simply clipping them into the range of the gamut.
Added this section to recommend that unsupported properties and values be ignored as if they were invalid.
Changed character encoding detection rule 2 to include a BOM and referred to additional rules below.
Added rule 4 to provide for use of the referring style sheet or document's character encoding.
Added rule 5 to require falling back to UTF-8.
Removed the restriction on using @charset in embedded style sheets.
Allowed a BOM to precede the @charset rule.
Added requirement that @charset rule must be a literal '@charset"...";', not a CSS-syntax equivalent.
Added requirement to support for UTF-8 at minimum.
Specified that any @charset rule not at the beginning of the style sheet must be ignored.
Removed note on theoretical problem with @charset problem and precisely defined rules for character encoding detection based on @charset and/or BOM.
Specified that UAs must ignore style sheets in unknown encodings.
RFC 3066 replaces RFC 1766.
Class selectors are allowed for other formats than HTML.
Added a note about matching classes in formats with multiple class attributes per element. The behavior is non-normative, because, at the time of writing, there exist no such formats.
Specified how to match elements with two or more ID attributes.
Removed exception for HTML UAs that allowed them (and only them) to ignore ':first-letter' and ':first-line'.
UAs may return a :visited link to :link status at some point. (This was previously a note, but is now normative.)
Added a note about privacy concerns with link pseudo classes and allowed UAs to treat :visited as :link.
The identifier C in ':lang(C)' need not be a valid language code, but it must not be empty.
':first-line' also applies to inline blocks, table captions and table cells. Added a definition of "first formatted line" to make the rules about which line is the first line more precise.
UAs are no longer forbidden from applying more properties than the given list.
More precise definition of first letter. Added rules for cases where the first letter is in an inline block or table cell. Added rules for cases when preceding punctuation is in a different element from the first letter itself.
UAs may apply other properties to first letters than the given list.
Unicode character classes Pi and Pf added to the definition of punctuation.
Redefined "computed value" and created the concept of "used value" so that inheritance can be performed without laying out the document. This change has the effect of allowing (requiring) percentages to be inherited as percentages and affects many other layout calculations throughout the spec.
Since computed value of a property can now also be a percentage. In particular, the following properties now inherit the percentage if the specified value is a percentage:
Note that only 'text-indent' inherits by default, the others only inherit if the 'inherit' keyword is specified.
Changed suggestion that user be able to turn off author styles to a requirement.
The "style" attribute now has a higher specificity than any style rule.
Pseudo-elements are now counted with elements in calculating a a selector's specificity.
"Non-CSS presentational hints" no longer exist, with the exception of a small set of attributes in HTML.
Added 'speech' media type.
Marked "Media" field in property descriptions informative.
Marked this section informative.
Added sound to 'handheld' in media type/media group table.
Changed 'tactile' to be both 'static' and 'interactive'.
If the containing block's width depends on an element with percentage margins, then the resulting layout is undefined in CSS 2.1.
In the definition of "collapsing margins", added "non-empty content" and "clearance" to the parenthetical list of things that prevent consecutive margins from being adjoining.
Vertical margins of elements with 'overflow' other than 'visible' no longer collapse with their in-flow children.
Defined how margins collapse through an element with adjoining top and bottom margins.
Added that margins of the root element's box do not collapse.
More rigorously defined "adjoining" for margin collapsing.
Sixth bullet, second sub-bullet: to find the position of the top border edge, assume the element has a bottom (rather than top) border.
Margins of relatively positioned elements do sometimes collapse.
If the containing block's width depends on an element with percentage padding, then the resulting layout is undefined in CSS 2.1.
'transparent' can now be specified independently for each border side, on par with <color>.
3D border styles ('groove', 'ridge', 'inset', 'outset') now depend on the corresponding border-color rather than on 'color'.
Added this new section to specify layout of inline boxes when affected by bidi.
Removed paragraphs about the initial containing block, as this is now defined differently. (See changes to section 10.1.)
Added a paragraph to define formatting when an inline box contains a block box.
Specified what property values are applied to anonymous boxes.
Specified that collapsed white space does not generate anonymous inline boxes.
Changed run-in rules so that a) run-ins that contain blocks become blocks b) run-ins can only run into sibling blocks and c) run-ins cannot run into other run-ins.
The 'marker' and 'compact' values of the 'display' property are not part of CSS 2.1. Text relating to these values has been removed throughout the specification.
Defined the computed value of 'display' as the specified value except for positioned and floating elements and for the root element. The computed value of 'display' for these elements is defined in section 9.7 and is slightly different from the definition in CSS2.
Conforming HTML UAs are no longer allowed to ignore the 'display' property.
The 'position' property now applies to all elements, including generated content.
The effect of relative positioning on table captions and internal table elements is undefined in CSS 2.1.
For fixed positioning, introduced a conflict between this section and section 10.1 rule 3. See howcome for rationale.
Forbid UAs from paginating the content of fixed boxes.
UAs are allowed to treat all values of 'position' as 'static' on the root element.
Defined computed values of 'top', 'right', 'bottom', 'left' based on the value of 'position'.
Percentage offsets are no longer undefined for containing blocks without an explicit height.
Specified that floats, absolutely positioned elements, inline-blocks, table-cells, table-captions, and elements with 'overflow' other than 'visible' establish new block formatting contexts.
In the paragraph about the position of a box's outer edge with respect to its containing block, except boxes that establish a new block formatting context, as they may become narrower due to floats.
Specified that the effect of 'justify' on the content of a line box does not affect the contents of inline-table and inline-block boxes.
Empty line boxes are now required to be treated as zero-height and ignored in margin collapsing.
Added several paragraphs and an example to explain exactly what the computed values of relatively-positioned offsets are, how they affect each other, and what happens when the positioning is overconstrained. (These were not previously defined.)
Floats are no longer required to have an explicit width.
Floats outside of line boxes no longer align to the bottom of the preceding block box; it is implied that they are initially aligned with their non-floated position.
Specified that "If a shortened line box is too small to contain any further content, then it is shifted downward until either it fits or there are no more floats present."
Specified that the border box of a table, block-level replaced element, or element in the normal flow that establishes a new block formatting context must not overlap any floats in the same block formatting context.
The 'float' property now also applies to :before/:after and generated content.
UAs are now allowed to treat all values of float as 'none' on the root element.
Added to rule 4 prose to define the position of a float when it occurs between two collapsing margins.
Defined clearance to precisely detail the 'clear' property's effect on margin collapsing and the block's cleared position.
Added note to explain effect of 'clear' on inline elements since CSS1 (but not CSS2 or CSS 2.1) allows 'clear' on inline elements.
Changed rules to convert 'display' not always to 'block', but to an appropriate block-level display value as given by a mapping table.
Added rule 4 to convert root element's 'display' value according to the mapping.
Specified that the background and borders of an element that forms a stacking context are behind all of its descendants, altered stacking context prose to be more precise, and added a normative Appendix E: Elaborate description of Stacking Contexts to be even more precise about the position of borders, backgrounds, and content on the z-axis.
Conforming UAs are now allowed to not support bidirectional text; in this case they must ignore the 'direction' and 'unicode-bidi' properties. However since applying bidi can have an effect even when a document doesn't contain right-to-left characters, UAs that do support bidi are no longer permitted to not apply the algorithm just because the document lacks right-to-left characters.
Added a paragraph to define precisely how the Unicode bidirectional algorithm applies to text in the CSS formatting model and how the CSS 'direction' property on blocks maps into the algorithm.
Conforming HTML UAs are no longer exempt from supporting 'direction' and 'unicode-bidi'.
Updated prose to use the terms "specified", "computed" and "used" as appropriate when referencing values. This affects many calculations in this section. (See changes to section 6.1.)
In rule 1, defined the initial containing block as the viewport for continuous media and the page area for paged media. (It was previously undefined.)
In rule 2, defined the page area as the containing block for fixed positioned elements in paged media.
In rule 4.1, when the containing block of an absolutely-positioned element is formed by an inline-level element, it is now formed by that element's padding edges, not its content edges.
In rule 4, changed the containing block for absolutely positioned elements with only statically positioned elements from the root's content box to the initial containing block.
Specified the positioning and breaking behavior of absolutely-positioned elements in paged media.
Declared that if the containing block's width depends on an element's percentage width, then the resulting layout is undefined in CSS 2.1.
The computed values of 'left' and 'right' for are now defined in section 9.3.2. The value 'auto' does not always compute to zero.
Added sections 10.3.9 and 10.3.10 to define calculations for inline blocks.
The sizing algorithm for replaced elements now takes into account and attempts to preserve the replaced content's intrinsic ratio. Sizing of replaced elements with percentage intrinsic sizes and without intrinsic sizes is now also defined.
The effect of percentage intrinsic widths is now undefined for CSS level 2, rather than ignored.
Specified that a computed total of the width, padding, and borders that is greater than the containing block width causes auto margins to be treated as zero in the rest of the rules. This avoids 'auto' margins being negative on the start edge.
Applied changes to section 10.3.2 and section 10.3.3 to block-level replaced elements in normal flow by referring to the calculations in those sections.
Defined computations for 'auto' width floats as shrink-to-fit. (Floats were previously required to have fixed widths.)
Applied changes to section 10.3.2 to this section by referencing it for 'auto' width calculations.
Defined the static position of an element more precisely.
Rewrote constraint rules.
The 'direction' property of the containing block of the static position determines which side is clamped to the static position, not the 'direction' property of the containing block of the absolutely positioned element.
In rule 1, applied sizing rules from section 10.3.2.
In rule 2 (formerly rules 2 and 3), referred to new definition of 'static position' in section 10.3.7.
Also in rule 2, the 'direction' property of the containing block of the static position determines which side is clamped to the static position, not the 'direction' property of the containing block of the absolutely positioned element.
In rule 4 (formerly rule 5), prevented 'auto' left and right margins in resulting in a negative margin on the start edge.
Specified that if the containing block's width is negative, the used value of a percentage min/max width is zero.
Specified that if the min/max width is specified in percentages and the containing block's width depends on this element's width, then the resulting layout is undefined in CSS 2.1.
The UA is no longer allowed to select an aribtrary minimum width.
The used width of replaced elements with an intrinsic ratio and both 'width' and 'height' specified as 'auto' is now calculated according to a table designed to preserve the intrinsic ratio as much as possible within the given constraints.
Removed mention of 'line-height' for inline elements since their content box height no longer depends on 'line-height'.
Percentage heights on absolutely-positioned elements are no longer treated as 'auto' when the containing block's height is not explicitly specified. Added a note to explain why this is possible.
Specified that a percentage height on the root element is relative to the initial containing block.
The computed values of 'top' and 'bottom' for are now defined in section 9.3.2. The value 'auto' does not always compute to zero.
Added section 10.6.6 to cover cases that are no longer covered under the previous sections.
Added section 10.6.7 to define 'auto' heights for block formatting context roots. (Unlike other block boxes, the height of these boxes increases to accomodate any normal-flow descendant floats.)
The height of an inline box is no longer given by the 'line-height' property and is now undefined. This section now suggests that the height of the box can be based on the font.
The sizing algorithm for replaced elements now takes into account and attempts to preserve the replaced content's intrinsic ratio. Sizing of replaced elements with percentage intrinsic sizes and without intrinsic sizes is now also defined.
Specified that for inline elements, the margin box is used when calculating the height of the line box.
This section now only applies to elements whose 'overflow' value computes to 'visible'; elements with other values of 'overflow' are discussed in the new section 10.6.7 ('Auto' heights for block formatting context roots).
Defined the static position of an element more precisely.
Rewrote constraint rules.
In rule 1, applied sizing rules from section 10.6.2.
Percentage min/max heights on absolutely-positioned elements are no longer treated as '0'/'none' when the containing block's height is not explicitly specified. However if the containing block's width depends on an element's percentage width, then the resulting layout is undefined in CSS 2.1.
The used width of replaced elements with an intrinsic ratio and both 'width' and 'height' specified as 'auto' is now calculated according to a table designed to preserve the intrinsic ratio as much as possible within the given constraints.
Added rule 4 to specify that the height of the line box must be at least as much as that specified by the 'line-height' property on the this block.
UAs are no longer permitted to clip content to the line box, and are instead asked to render overlapping boxes in document order.
'line-height' set on a block no longer specifies the minimal height of each inline box; instead it specifies the minimal height of each line box. The exact effect of this requirement is expressed in terms of struts; it is affected by vertical-alignment.
Adjusted text to reflect that the content box height of an inline is no longer dictated by the 'line-height' property.
Since the content box is now defined by the font and not by the line-height, 'text-top' and 'text-bottom' refer to the content area instead of the font.
Defined 'top' and 'bottom' alignment in terms of aligned subtrees to take into account any protruding descendants.
Defined the baseline of inline tables and inline blocks.
Specified that 'overflow' clips to the padding edge.
'projection' media are no longer permitted to print overflowing content for 'overflow: scroll'. 'print' media now may, as opposed to should.
UAs are now required to apply the 'overflow' property set on the root element to the viewport. Additionally, HTML UAs must use the 'overflow' property on the HTML BODY element instead if the root element's 'overflow' value is 'visible'.
Specified placement of scrollbar in the box model.
The width of any scrollbars is no longer included in the width of the containing block. (And consequently, all text in section 10.3 that subtracts the scrollbar width from the containing block width has been removed.)
The 'clip' property now applies only to absolutely positioned elements. Furthermore, it applies to those elements even when their 'overflow' is 'visible'.
The default value of 'clip', 'auto', now indiciates no clipping rather than clipping to the element's border box.
Values of "rect()" should be separated by commas. UAs are required to support this syntax, but may also support a space-separated syntax since CSS2 was not clear about this.
While CSS2 specified that values of "rect()" give offsets from the respective sides of the box, current implementations interpret values with respect to the top and left edges for all four values (top, right, bottom, and left). This is now the specified interpretation.
The 'visibility' property is now defined to inherit, and descendant elements can override an ancestor's hidden visibility.
Moved all discussion of aural rendering to Appendix A.
Removed restrictions on which properties and property values are allowed on ':before' and ':after' pseudo-elements.
The initial value of 'content' is now 'normal', not the empty string.
The 'content' property now distinguishes between the empty string, which creates an empty box; and 'normal'/'none', which create no box at all. (There is no distinction between 'normal' and 'none' in level 2.)
A UA is now allowed to report a URI that fails to download.
Removed recommendation to authors to put rules with media-sensitive 'content' properties inside '@media'.
Whether '\A' escapes in generated content create line breaks is now subject to the 'white-space' property.
The former section 12.3 on interaction between ':before', ':after' and elements with 'display: compact' or 'display: run-in' has been removed. (The interaction is already fully defined, because generated content consists of boxes in the tree, no different from other boxes.)
Specified that extra 'close-quote's and 'no-close-quote's (those without a matching 'open-quote' or 'no-open-quote') are not rendered, and that neither 'close-quote' nor 'no-close-quote' cause the quoting depth to be negative.
Defined what a rule with duplicate counters, such as 'counter-reset: section 2 section', means.
The scope of a counter no longer defaults to the whole document, but starts at the first element that uses the counter. (This affects counters that are used without a prior 'counter-reset' to set the scope explicitly.)
Removed text in section 12.5 (formerly 12.6) relating to the 'marker' display value.
Removed the 'marker-offset' property (and thus former section 12.6.1).
The list styles 'hebrew', 'armenian', 'georgian', 'cjk-ideographs', 'hiragana', 'katakana', 'hiragana-iroha' and 'katakana-iroha' have been removed due to lack of implementation experience. (They are expected to return in the CSS3 Lists module.)
Removed the sentence that said that an unknown value for 'list-style-type' should cause the value 'decimal' to be used instead. Instead, normal parsing rules apply and cause the rule to be ignored.
The size of list style markers without an intrinsic size is now defined.
The 'size', 'marks', and 'page' properties are not part of CSS 2.1.
The requirement for UA's to honor different declarations for :left, :right, and :first pages has been softened to simplify implementations: the page area of the :first page may be used for :left and :right pages as well.
UAs are now only required to apply the page break properties to block-level elements in the normal flow of the root element, not to other blocks.However, UAs are now permitted to apply these properties to elements other than block-level elements.
Defined treatment of margins, borders, and padding when a page break splits a box.
The 'page-break-inside' property no longer inherits.
The 'page-break-inside' property of all ancestors is checked for page-breaking restrictions, not just that of the breakpoint's parent.
When dropping restrictions to find a page breaking opportunity, rule A is dropped together with B and D rather than together with C.
Removed restriction on breaking within absolutely positioned boxes.
For 'background-position', the restriction that keywords cannot be combined with percentage or length values is removed. I.e., a value like: '25% top' is now allowed. Also, 'background-position' now applies to all elements, not just to block-level and replaced elements.
User agents are no longer allowed to treat a value of 'fixed' for 'background-attachment' as 'scroll'. Instead they must ignore all such declarations as if 'fixed' were an invalid value.
The size of background images without an intrinsic size is now defined.
The contents of this section is now a non-normative note.
The 'font-stretch' and 'font-size-adjust' properties have been removed in CSS 2.1.
Font descriptors, the '@font-face' declaration, and all associated parts of the font matching algorithm have been removed in CSS 2.1.
In this section (previously 15.5), in step 5 (prevously 8) of the font matching algorith, the UA is now allowed to use multiple default fallback fonts to find a glyph for a given character.
In the per-property rule 2, specified that if there is only a small-caps font in a given family, then that font will be selected by 'normal'.
The "missing character" glyph is no longer considered a match for the last font in a font set, but is now considered a match for U+FFFD.
Certain punctuation characters when appearing in unquoted font family names are now required to be escaped.
The 'font-variant' property's effect is no longer restricted to bicameral scripts.
The computed value of 'font-weight' has been defined more precisely such that the 'bolder' and 'lighter' values have an appropriate effect when inheriting through elements with different font-families.
Removed suggestion of 1.2 fixed ratio between keyword font sizes in favor of notes recommending a variable ratio and a smallest font-size no less than 9 pixels per EM unit.
Added table mapping CSS font-size keywords to HTML font size numbers.
The 'text-shadow' property is not in CSS 2.1.
The initial value of 'text-align' is no longer UA-defined but a nameless value that acts as 'left' if 'direction' is 'ltr', 'right' if 'direction' is 'rtl'.
The <string> value for 'text-align' is not part of CSS 2.1.
For 'text-align', specified that 'justify' is treated as the initial value when computed value of 'white-space' is 'pre' or 'pre-line'.
More precisely defined what boxes are affected by text decorations specified on a given element.
Specified that underlines, overlines, and line-throughs apply only to text.
Specified that an underline, overline, or line-through applied across a line must be at a constant vertical position and with a constant thickness across the entire line.
Specified how text decorations are affected by relative positioning on descendants.
User agents are now allowed to recognize the 'blink' value but not blink, whereas before they were required to ignore the 'blink' value if they chose not to support blinking text.
Added text to allow older UAs to conform to this section if they follow CSS2's 'text-decoration' requirements but not the additional requirements in CSS2.1.
Support for the various values of 'letter-spacing' and 'word-spacing' is no longer optional.
Specified that word spacing affects each space, non-breaking space, and ideographic space left in the text after white space processing rules have been applied.
UAs are no longer allowed to not transform characters for which there is an appropriate transformation but which are outside of Latin-1.
The 'white-space' property now applies to all elements, not just to block-level elements.
"\A" in generated content no longer forces a break for 'normal' and 'nowrap' values of 'white-space'.
Specified that the CSS white space processing model assumes all newlines have been normalized to line feeds.
Added section 16.6.1 to precisely define white space handling.
Added section 16.6.3 to specify handling of control and combining characters.
Moved all discussion of aural rendering and related properties to Appendix A.
Updated prose to use the terms "specified", "computed" and "used" as appropriate when referencing values. (See changes to section 6.1.)
Defined handling of multiple 'table-header-group' and 'table-footer-group' elements.
UAs are no longer allowed to ignore the table display values on arbitrary HTML elements, only on HTML table elements.
Changed rules so that internal table elements without an enclosing 'table' or 'inline-table' box generate an anonymous 'inline-table' rather than an anonymous 'table' when inside a "display: inline" parent element.
The anonymous table object rules now treat anonymous boxes as equal to elements' boxes. Replaced several instances of the term "element" with "box", removed several instances of "(in the document tree)" and clarified that anonymous boxes generated in earlier rules are part of the input to later rules. Also replaced the term "object" with "box", as is used throughout the rest of the specification.
HTML UAs are no longer exempt from the anonymous box generation rules.
The relationship of the caption box, table box, and outer anonymous table box has been changed as follows:
The 'left' and 'right' values on 'caption-side' have been removed.
Changed rule 5 in grid layout rules to allow overlapping of table cells instead of leaving skipping a gap in the grid to avoid overlap.
In point 6, changed 'These "empty" cells are transparent' to:
If the value of their 'empty-cells' property is 'hide' these "empty" cells are transparent through the cell, row, row group, column, and column group backgrounds, letting the table background show through.
Specified that in fixed table layout, extra columns in rows after the first must not be rendered.
Restricted inputs to the table layout algorithm for 'table-layout: auto', whether or not the algorithm described in this section is used, to the width of the containing block and the content of, and any CSS properties set on, the table and any of its descendants.
Added rule 4 to include the column group's width in the algorithm for determining column widths.
The 'height' property on tables is now treated as a mininimum height; the UA no longer has the option of using 'height' to constrain the size of the table to be smaller than its contents.
Percentage heights on table cells, rows, and row groups now compute to 'auto'.
The baseline of a cell is now defined much more precisely.
Defined the baseline of a row with no baseline-aligned cells.
The <string> value for 'text-align' is not part of CSS 2.1.
Several popular browsers assume an initial value for 'border-collapse' of 'separate' rather than 'collapse' or exhibit behavior that is close to that value, even if they do not actually implement the CSS table model. 'Separate' is now the initial value.
Specified the effect of padding on the table element.
Specified which parts of the table are included in the width measurement.
Refined definition of "empty" when used as a condition for the 'empty-cells' property so that it is not triggered when the cell includes any child elements, even if they are empty.
The 'empty-cells' property now hides both borders and backgrounds, not just borders.
Changed behavior of a row when it collapses due to 'empty-cells': it is no longer treated as "display: none". Instead it is given zero height and its associated border-spacing is eliminated.
The outer half of the table borders no longer lie in the margin area. Specified which part of the table is considered the border are in the collapsed borders model and how its width is calculated. The edges of the box in which the table background is painted is, however left explicitly undefined.
Defined in rule 4 what happens when two elements of the same type conflict and their borders have the same width and style.
The size of cursors without an intrinsic size is now defined.
Position of outline with respect to the border edge is now only suggested, not required.
Conformant UAs are now allowed to ignore the 'invert' value. In such UAs the initial value of 'outline-color' is the value of the 'color' property.
The 'marker' value for 'display' does not exist in CSS 2.1
Chapter 19 on aural style sheets has become appendix A and is not normative in CSS 2.1. Related units (deg, grad, rad, ms, s, Hz, kHz) are also moved to this appendix, as is the 'speak-header' property from the "tables" chapter and other notes on aural table rendering. The 'aural' media type is deprecated in favor of the new 'speech' media type.
Changed the initial value of 'pause-before' and 'pause-after' to be 0 instead of UA-defined.
A note has been added to this section (formerly 19.4) about the change in position and behavior of pauses in CSS3 Speech compared to this appendix.
This section (formerly Section 19.5) now specifies the placement of cues and pauses with respect to the :before and :after pseudo-elements.
The keywords 'mix' and 'repeat' may now appear in either order.
Various references in Appendix B (formerly Appendix E) have been updated as appropriate.
Switched [CSS1] from Normative to Informative.
Updated URI reference from [RFC1808] and the draft-fielding-uri-syntax-01.txt to [RFC3986].
Updated HTTP reference from [RFC2068] to [RFC2616].
Removed normative references to [IANA] and [ICC32].
Added normative references to [ICC42], [RFC3986], [RFC2070], [UAAG10].
Added informative references to CSS2, CSS3 Color, CSS3 Lists, Selectors, CSS3 Speech, DOM 3 Core, MathML 2, P3P, RFC1630, SVG 1.1, XHTML 1, XML ID, and XML Namespaces.
Removed informative references to [ISO10179] (DSSSL), [INFINIFONT], [ISO9899] (C), [MONOTYPE], [NEGOT], [OPENTYPE], [PANOSE], [PANOSE2], [POSTSCRIPT], [RFC1866] (HTML 2), [RFC1942] (HTML Tables), [TRUETYPEGX], [W3CStyle].
Updated language tags references from [RFC1766] to [3066].
The former informative appendix C, "Implementation and performance notes for fonts," is left out of CSS 2.1.
Shorthand properties take a list of subproperty values or the value 'inherit'. One cannot mix 'inherit' with other subproperty values as it would not be possible to specify the subproperty to which 'inherit' applied. The definitions of a number of shorthand properties did not enforce this rule: 'border-top', 'border-right', 'border-bottom', 'border-left', 'border', 'background', 'font', 'list-style', 'cue', and 'outline'.
The "applies to" line of many property definitions has been made more accurate by excluding or including table display types where appropriate.
DELIM should not have included single or double quote. Refer also to section 4.1.6 on strings, which must have matching single or double quotes around them.
Removed "A-Z" from the "nmchar" token: as CSS is case insensitive anyway, it was redundant.
Corrected "unicode" macro to treat CRLF as a single character.
Corrected "block" production to allow white space between declarations.
In the rule for "any" (in the core syntax), corrected "FUNCTION" to "FUNCTION any* ')'".
Corrected third paragraph to say that an '@import' rule can only be preceeded by an '@charset' rule or other '@import' rules.
Several values described in subsections of this section incorrectly allowed two "+" or "-" signs at their beginnings.
Fixed double sign error in definition of <length>. (<number> already has a sign.)
Corrected the suggested reference pixel to be based on a 96 dpi device, not 90 dpi. The visual angle is thus about 0.0213 degrees instead of 0.0227, and a pixel at arm's length is about 0.26 mm instead of 0.28
Corrected last sentence to refer to a unsupported used length, not an unsupported specified length.
Fixed double sign error in definition of <percentage>. (<number> already has a sign.)
Defined escaping requirements in terms of the URI token so that no escaping requirements are missing from the prose.
Included invalid URIs in last paragraph about URI error handling.
Corrected syntax of counter() and counters() notation to allow white space between tokens.
Deleted the comments about range restriction after the following examples:
em { color: rgb(255,0,0) } em { color: rgb(100%, 0%, 0%) }
(Formerly section 4.3.10) Corrected text to allow all forms of Unicode escapes for U+000A, not just the "\A" form, for including newlines in strings.
In the second bullet, added that the ':lang()' pseudo-class can also be deduced from the document in some cases.
Removed paragraph about imported style sheets being overridden by rules in the importing style sheet: imported style rules follow the cascade as specified in 6.4.1 Cascading order, exactly as if they were inserted in place of the @import rule.
The definition of "content edge" has been changed to depend on 'width' and 'height' rather than directly on 'rendered content'.
From the definition of "padding edge", deleted the sentence "The padding edge of a box defines the edges of the containing block established by the box." For information about containing blocks, consult Section 10.1.
The colors in the example HTML did not match the colors in the image.
Changedvarious border shorthands' syntax definitions to use the <border-width>, <border-style> and <'border-top-color'> value types as appropriate.
Excepted table elements from second paragraph about principal block boxes and their contents.
Corrected sentence to say "either only block boxes or only inline boxes" instead of "only block boxes".
In the definition of "position: static", added 'right' and 'bottom' to the sentence saying that 'top' and 'left' do not apply.
The properties 'top', 'right', 'bottom', and 'left', incorrectly referred to offsets with respect to a box's content edge. The proper edge is the margin edge. Thus, for 'top', the description now reads: "This property specifies how far a box's top margin edge is offset below the top edge of the box's containing block."
Corrected text under property definitions to say that for relatively-positioned elements, 'top', 'right', 'bottom', and 'left' define the offset from the box's position in the normal flow, not from the edges of the containing block. (The previous definition conflicted with that was further down; since that text is now redundant, it has been removed.)
In paragraph about relationship of a box's outer edges to its containing block's edges, corrected parenthetical to say that line boxes, not the content area, may shrink due to floats.
Added "and the presence of floats" to "The width of a line box is determined by a containing block".
In the first paragraph, added "or floated" to the phrase "laid out according to the normal flow" as floated elements can be relatively positioned but are not part of the normal flow.
Corrected sentence about not enough horizontal room for the float to say that it is shifted downward until either it fits or there are no more floats present.
Correct "Applies to" line and prose to say that the 'float' property can be set for any element but only applies to elements that are not absolutely positioned.
Removed sentence saying that 'clear' may only be specified for block-level elements: it can be specified for any element, it only applies to block-level elements.
Corrected sentence that said absolutely positioned boxes establish a new containing block for absolutely positioned descendants to except fixed positioned descendants.
In rule 1, corrected "user agents must ignore 'position' and 'float" to "'position' and 'float' do not apply".
Corrected note about 'direction' on table column elements to say that "columns are not the ancestors of the cells in the document tree" rather than saying "columns don't exist in the document tree".
Added table cells, table captions, and inline blocks alongside block-level elements in description of 'bidi-override' value. Also corrected the prose to handle anonymous child blocks.
Updated mention of Unicode's embedding limit from 15 to 61.
Included table cells (and inline blocks) together with block-level elements in rule 2 defining the containing block of non-absolutely-positioned elements.
In the last sentence of the paragraph following the equation ("If the value of 'direction' is 'ltr', this happens to 'margin-left' instead") substituted 'rtl' for 'ltr'.
The initial value for 'min-width' is now '0' rather than UA-dependent.
Corrected "applies to" exception for both 'min-width' and 'max-width' from "table elements" to "table rows and row groups".
Specified that negative values for 'min-width' and 'max-width' are illegal.
Added that 'auto' height also depends on whether the element has padding or borders, as these influence margin-collapsing behavior.
Added text to correctly account for margin collapsing behavior.
Corrected "applies to" exception for both 'min-width' and 'max-width' from "table elements" to "table columns and column groups".
Specified that negative values for 'min-height' and 'max-height' are illegal.
Corrected "applies to" line for 'overflow' from "block-level and replaced elements" to "non-replaced block-level elements, table cells, and inline-block elements".
The example of a DIV element containing a BLOCKQUOTE containing another DIV was not rendered correctly. The first style rule applied to both DIVs, so the second DIV box should have been rendered with a red border as well. The second DIV has now been changed to a CITE, which doesn't have a red border.
Corrected "rect (<top> <right> <bottom> <left>)" to "rect(<top>, <right>, <bottom>, <left>)".
Corrected initial value of 'visibility' to 'visible'.
The example used the style 'hebrew', which doesn't exist in CSS level 2. Changed to 'lower-greek'.
Under the 'list-style' property, the example:
ul > ul { list-style: circle outside } /* Any UL child of a UL */
could never match valid HTML markup (since a UL element cannot be a child of another UL element). An LI has been inserted in between.
Second sentence: "In terms of the box model, 'background' refers to the background of the content and the padding areas" now also mentions the border area. (See also errata to section 8.1 above.) Thus:
In terms of the box model, "background" refers to the background of the content, padding and border areas.
Under 'background-image', defined the image tile size used when the background image has intrinsic sizes specified in percentages or no intrinsic size.
Under 'background-repeat', the sentence "All tiling covers the content and padding areas [...]" has been corrected to
"All tiling covers the content, padding and border areas [...]".
Under 'background-attachment', the value 'scroll' is defined to scroll with the "containing block" rather than with the "document". Also the sentence "Even if the image is fixed [...] background or padding area of the element" has been corrected to
Even if the image is fixed, it is still only visible when it is in the background, padding or border area of the element.
In bullet 2, changed "the UA uses the 'font-family' descriptor" to "the UA uses the 'font-family' property".
The statement "Negative values are not allowed" for 'font-size' now applies to percentages as well as lengths.
Corrected 'text-indent' to apply to table cells (and inline blocks) as well as block-level elements.
Corrected 'text-align' to apply to table cells (and inline blocks) as well as block-level elements.
Changed prose about the effect of 'justify' to be less correct.
Corrected the note to say that justification is also dependent on the script, not just the language, of the text.
In the definition of table-header-group, changed "footer" to "header" in "Print user agents may repeat footer rows on each page spanned by a table."
Added 'table-header-group' and 'table-footer-group' alongside mentions of 'table-row-group' where missing.
Corrected 'caption' to 'table-caption'.
Added missing rule (#3) for 'table-column' boxes.
Added 'table-caption' and 'table-column-group' to list of boxes requiring a 'table' or 'inline-table' parent in rule 4.
Added rules 5 and 6 to generate 'table-row' boxes where necessary for children of 'table'/'inline-table' and 'table-row-group'/'table-header-group'/'table-footer-group' boxes.
Specified handling of multiple caption boxes.
Specified that the anonymous outer table box is a 'block' box if the table is block-level and an 'inline-block' box if the table is inline-level but that the anonymous outer table box cannot accept run-ins.
Correct text that said all internal table elements have padding; change to say that of these only table cells have padding.
The following note:
Note. Table cells may be relatively and absolutely positioned, but this is not recommended: positioning and floating remove a box from the flow, affecting table alignment.
has been amended as follows:
Note. Table cells may be positioned, but this is not recommended: absolute and fixed positioning, as well as floating, remove a box from the flow, affecting table size.
The rows and columns only cover the whole table in the collapsed borders model, not in the separated borders model.
The points 2, 3, 4 and 5 have been corrected to define the area covered by rows, columns, row groups and column groups and thus the positioning and painting of backgrounds on those elements.
Specify the handling of "missing cells".
In the image, changed "cell-spacing" to "border-spacing".
For the 'ButtonHighlight' value, changed the description from "Dark shadow" to "Highlight color".
Changed "but any descendants which actually create a new stacking context" to "but any positioned descendants and descendants which actually create a new stacking context" (3 times).
This change also occurred once in section 9.5 (Floats) and once in section section 9.9 (Layered presentation).
This section has been marked non-normative.
This section has been marked non-normative.
Added a statement about case-sensitivity of selectors for XML.
The specification for the XML
style sheet PI
was written after CSS2 was finalized. The first line of the full XML
example should not have been be <?XML:stylesheet type="text/css"
href="bach.css"?>
, but
<?xml-stylesheet type="text/css" href="bach.css"?>
This section has been marked non-normative.
Added a note to clarify that the deprecated/non-deprecated status of a feature is distinct from its normative/non-normative status.
Under 'document language' clarified that CSS only describes the presentation of a document language, and has no effect on its semantics.
Changed definition of 'replaced element' to "an element whose content is outside the scope of the CSS formatting model" and added further clarifying text. This clarifies that e.g. SVG images embedded in an XML document are also considered replaced elements, not just those linked in from an outside file. Also changed definition of 'rendered content' to be consistent with this clarification.
Added under "Intrinsic dimension" that raster images without reliable resolution information are assumed to have a size of 1 px unit per image source pixel.
Added definition for 'ignore'.
Added definition for 'HTML user agent'.
Added definition for 'property'.
Moved definitions of "immediately before" and "immediately after" forward so they apply to the whole Syntax section.
Added sections 4.1.2.1 and 4.1.2.2 to defined vendor-specific extensions.
Clarified that input that cannot be parsed according to the core syntax is ignored according to the rules for handling parsing errors.
Clarified that input that cannot be tokenized or parsed has no meaning in CSS2.1.
Clarified that when a CRLF pair terminates an escape sequence, the pair is treated as a single white space character as corrected in the tokenization rules.
Replaced "[a-z0-9]" by "[a-zA-Z0-9]" as an extra reminder that CSS identifiers are case-insensitive.
Replaced the term "{}-block" with "declaration block".
Clarified that all property:value combinations and @-keywords that do not contain an identifier beginning with dash or underscore are reserved by CSS for future use.
Clarified that when something inside an at-rule is ignored because it is invalid, this does not make the entire at-rule invalid.
Referenced section 4.1.7 for parsing invalid bits inside declaration blocks.
Clarified that '-0' is equivalent to '0' and is not a negative number.
Clarified that negative length values on properties that don't allow them cause the declaration to be ignored.
Reduced unnecessary discussion of what a URI is.
Added note about terminology change ("simple selector") between CSS2 and CSS3.
Clarified that text nodes and comments do not affect whether a sibling selector matches.
Clarified ~= and |= by using the definitions from the Selectors module.
Clarified that rules about default attribute values are the same, whether the default is specified in a DTD or by other means.
Added a note that it depends on the document format which attributes are ID attributes.
Clarified that CSS 2.1 does not define if the parent of an element that matches ':active' or ':hover' itself also matches ':active' or ':hover'.
Added note that, in CSS1, ':active' only applies to links.
Added a note to show the differences between ':lang(xx)' and '[lang=xx]'.
Clarified that digits can also be first letter.
Clarified that computed values are inherited (not specified values) and that they become the specified value on the inheritor.
Removed discussion of "default" styles for a document.
Clarify that 'inherit' can be used on properties that are not normally inherited and that when set on the root element, it has the effect of assigning the property's initial value.
Except @charset from the statement that @imports must precede all other rules.
Obfuscated note about system settings and UA limitations.
Various editorial changes to clarify sort order.
Added a note:
The specificity is based only on the form of the selector. In particular, a selector of the form "
[id=p33]
" is counted as an attribute selector (a=0, b=1, c=0), even if theid
attribute is defined as an "ID" in the source document's DTD.
Clarify that Style rules outside of @media rules apply to the same media types that the style sheet itself applies to.
Added text to clarify that media types are mutually exclusive, but a UA can render simulatenously to canvases with different media types.
Split "aural" media group into "audio" and "speech".
The background style of the content, padding, and border areas of a box is specified by the 'background' property of the generating element. Margin backgrounds are always transparent.
Added a sentence to note that vertical margins have no effect on non-replaced inline elements.
Changed "absolute maximum" to "maximum of the absolute values" in sentence about negative margins collapsing.
Added this clarifying note to the first bullet of the explanation of vertical collapsing of margins:
Note. Adjoining boxes may be generated by elements that are not related as siblings or ancestors.
Emphasized that floating elements' margins do not collapse even between a float and its in-flow children.
Emphasized that absolutely positioned elements' margins do not collapse even between the positioned element and its in-flow children.
Changed description of 'none' value to not imply that all four border widths are set to zero.
Changed the sentence "When the viewport is smaller than the ..., the user agent should offer a scrolling mechanism" to use "area of the canvas on which the document is rendered" instead of "document's initial containing block".
Clarified that 'display: none' also applies to non-visual media.
Clarified that the margins of fixed positioned boxes do not collapse with any other margins.
Clarified that in print media fixed boxes are rendered on every page.
Clarified that negative lengths and percentages are allowed as values of 'top', 'right', 'bottom', and 'left'.
Added "For replaced elements, the effect of this value depends only on the intrinsic dimensions of the replaced content. See the sections on the width and height of absolutely positioned, replaced elements for details." to the definition of 'auto' because that's not what chapter 10 says at all.
Clarified that 'justify' stretches "spaces and words in inline boxes"; previous text simply said that it stretches "inline boxes".
The statement "When an inline box is split, margins, borders, and padding have no visual effect where the split occurs." has been generalized. Margins, borders, and padding have no visual effect where one or more splits occur.
Clarified that an inline box that exceeds the width of a line box and cannot be split therefore overflows the line box.
Removed sentence about formatting of margins, borders, and padding for split inline boxes not being fully defined when affected by bidi as that situation is now defined in section 8.6.
Clarified that although relative positioning normally doesn't directly affect layout, it may affect layout indirectly through the creation of scrollbars.
Relatively positioned boxes do not always establish new containing blocks. Changed the second paragraph to refer to the section on containing blocks accordingly.
The paragraph about dynamic movement and superscripting has been shifted into a non-normative note.
Clarified that line boxes are shortened to make room for the margin box of the float.
Added some text to clarify what "Any content in the current line before a floated box is reflowed in the first available line on the other side of the float" means.
Clarified floats' position in the stacking order.
Clarified that the elements referenced in the float behavior rules are in the same block formatting context as the float.
Clarified that the effects of 'clear' do not consider floats in other block formatting contexts.
Added a note to clarify that the images in this section are not drawn to scale and are illustrations, not reference renderings.
Noted that a containing block formed by inline elements may wind up with a negative containing block width.
In the definition of <length> values for the 'width' property, changed "Specifies a fixed width" to "Specifies the width of the content area using a length unit".
Clarified that setting both left and right margins to 'auto' horizontally centers the element within its containing block.
Clarified which part of the text of section 10.3.7 is re-used.
Clarified that 'min-width' and 'max-width' do not affect the computed values of any properties. (They only affect the used value.)
Clarified that these rules apply to the root element just as to any other element.
Clarified that 'min-width' and 'max-width' do not affect the computed values of any properties. (They only affect the used value.)
Removed clarifying note about line height being taller than tallest single inline box due to vertical alignment.
Removed "slightly" from the note "Values of this property have
slightly different meanings in the context of tables."
Clarified when absolute positioning and negative margins cause overflow.
Added 'text-indent' to the list of things that can cause overflow.
Removed mention of 'clip' since it no longer affects most elements; mentioned that the 'overflow' property also specifies whether a scrolling mechanism is provided to access clipped content.
Clarified that descendant elements whose containing block is the viewport or an ancestor of the element are not affected by overflow clipping.
Removed unnecessary mentions of the 'clip' property from the 'hidden' value definition.
Changed "portion of an element's rendered content" to "portion of an element's border box" since clipping also affects the element's backgrounds and borders.
Clarified what parts of the element are affected by clipping.
Clarified that clipped content does not cause overflow.
Clarified that arguments of clip() can be separated by spaces or by commas, but not a combination.
Clarified that descendants of a 'visibility: hidden' element will be visible if they have 'visibility: visible'.
Clarified that :before and :after pseudo-elements interact with other boxes as if they were real elements just inside their associated element.
Noted that the interaction of :before and :after with replaced elements is left undefined for now.
Clarified which counters are used for counter() and counters() in case there are multiple counters of the same name.
Removed note about common typographic practices when quotes in different languages are mixed.
In the "self-nesting" behavior of counters, clarified that merely using a counter in a child element doesn't create a new instance of it: only resetting it does.
Clarified that the scope of a counter does not include any elements in the scope of a counter with the same name created by a 'counter-reset' on a later sibling or a later 'counter-reset' on the same element.
Removed sentence about scope of 'counter-increment' without prior 'counter-reset' as that is now defined (differently) under "12.4.1 Nested counters and scope."
Clarified that pseudo-elements that generate no boxes also do not increment counters.
Clarified that the root background image, although painted over the entire canvas, is anchored as if painted only for the root element, and that the root's background is only painted once.
Clarified rules for propagation of background settings on HTML's <body> element to the root.
Added statement about z-index of backgrounds for elements that form a stacking context and referred to z-index property for details.
Added this note after the first paragraph after 'background-attachment':
Note that there is only one viewport per document. I.e., even if an element has a scrolling mechanism (see 'overflow'), a 'fixed' background doesn't move with it.
Definition of 'background-position' has been rewritten as normative rules rather than just examples.
Stated that the tiling and positioning of background images for inline elements is undefined in CSS2.1.
Drastically shortened introduction.
In the per-property rule 2, clarified that 'normal' matches the non-small-caps variant (if there is one).
Removed discussion of font-matching algorithm. (It is already covered in the font-matching algorithm's own section.
Clarified that quoted strings that are the same as a keyword value must be treated as font family names and not as the keyword value (which must be unquoted).
This section, previously section 15.2.6, has been moved but no other change was made.
The text for this section (formerly part of 15.2.3) has been reverted to its CSS1 format.
The text for this section (formerly part of 15.2.3) has been reverted to its CSS1 format.
Clarified that CSS2.1 cannot select font variants besides small-caps.
Clarified that when "font-variant: small-caps" results in the substitution of full-caps, the behavior is the same as for text-transform.
The text for this section (formerly part of 15.2.3) has been reverted to its CSS1 format. Also, discussion of font-weight from other parts of the Fonts chapter has been aggregated under this section.
Removed statemnt that says "User agents must map names to values in a way that preserves visual order; a face mapped to a value must not be lighter than faces mapped to lower values." This is otherwise implied by "The only guarantee is that a face of a given value will be no less dark than the faces of lighter values."
Clarified relationship of font size to em squares.
Added a totally irrelevant note about font sizes virtual reality scenes.
Clarified that text overflowing due to text-indent is affected by the 'overflow' property.
Added a note about text-indents inheriting behavior and suggesting 'text-indent: 0' on inline-blocks.
Changed "double justify" to "justify" under "left, right, center, and justify".
Added an example to illustrate how underlining affects descendant boxes.
Switched language reference from RFC2070 to RFC3066.
Added section 16.6.1 as an example to illustrate the interaction of white space collapsing and bidi.
Expanded introduction to include a brief discussion of the two table layout models. Mentioned that the automatic table algorithm is not fully defined in CSS 2.1 but that some implementations have achieved relatively close interoperability.
Clarify that all table captions must be rendered if more than one exists.
Specified that replaced elements with table display values are treated as table elements in table layout.
Moved the first bullet text to the prose before the list of generation rules as it is a general statement of what the rules are supposed to accomplish.
Clarified that "display: table" elements behave as block-level elements and "display: inline-table" elements behave as inline-level elements and not the other way around.
Clarified that 'table-caption' boxes behave as normal block boxes within the outer anonymous table box.
Clarified that percentage 'width' and 'height' on the table box is relative to the anonymous box's containing block, not the anonymous box itself.
Clarified that the 'position', 'float', 'top', 'right', 'bottom', and 'left' values on the table box are used on the anonymous outer box instead of the table box and that the table box itself uses the initial values of those properties.
To remove ambiguity about the position of extent of internal table boxes, the following paragraph was added after point 6:
the edges of the rows, columns, row groups and column groups in the collapsing borders model coincide with the hypothetical grid lines on which the borders of the cells are centered. (And thus, in this model, the rows together exactly cover the table, leaving no gaps; ditto for the columns.) In the separated borders model, the edges coincide with the border edges of cells. (And thus, in this model, there may be gaps between the rows and columns, corresponding to the 'border-spacing' property.)
Changed warning note about positioning of table cells to be more precise about the possibly unintended effects.
At the end of the section added the following paragraph:
Note that if the table has 'border-collapse: separate', the background of the area given by the 'border-spacing' property is always the background of the table element. See 17.6.1
Added a paragraph to clarify the interaction of the table width algorithms with the rules in section 10.3 (Calculating widths and margins).
Explicitly mentioned that the fixed table layout algorithm may be used with the algorithm of section 10.3.3 when 'table-layout' is 'fixed' but 'width' is 'auto'.
Clarified that UAs can use other algorithms besides the one in this section even if it results in different behavior. Also marked the rest of the section non-normative in accordance with that statement.
Changed "The horizontal alignment of a cell's content within a cell box is specified with the 'text-align' property" to "The horizontal alignment of a cell's inline content within a cell box can be specified with the 'text-align' property."
Clarified that not affecting layout means that 'visibility: collapse' causes the part of row- and column-spanning cells that span into the collapsed row to be clipped.
Added a note explaining that 'border-spacing' can be used as a substitute for the non-standard 'framespacing' attribute on frameset elements (which are out-of-scope for CSS2.1).
Added clarification about backgrounds: the sentence "This space is filled with the background of the table element" was replaced by:
In this space, the row, column, row group, and column group backgrounds are invisible, allowing the table background to show through.
In the sentence after the question, added "and padding-lefti and padding-righti refer to the left (resp., right) padding of cell i."
Noted that system colors are deprecated in CSS3.
Clarified that outlines do not cause overflow.
Clarified that outlines are only fully connected "if possible".
Clarify that changing outlines in response to focus should not cause a document to reflow.
Added paragraph clarifying that some presentational markup in HTML can be replaced with CSS, but it requires different markup.
Errata to CSS 2.1 since CR version of July 19, 2007.
[2009-04-15] The notation “&&” may be used in syntax definitions in future CSS specifications.
[2008-08-19] The first part of the section is not normative.
[2007-11-14] Append For raster
images without reliable resolution information, a size of 1 px
unit per image source pixel must be assumed.
to the
definition of intrinsic dimensions.
[2007-09-27] Remove DELIM?
from
the grammar rule
declaration :DELIM?property S* ':' S* value;
The DELIM was allowed there so that unofficial properties could
start with a dash (-), but the dash was already allowed because of the
definition of IDENT.
[2009-02-02] Change U to
u in token UNICODE-RANGE. (It means the same, but seems to
avoid confusion.)
[2009-02-02] Clarify where comments are allowed:
COMMENT tokens do not occur in the grammar (to keep it readable), but any number of these tokens may appear anywhere
betweenoutside other tokens. (Note, however, that a comment before or within the @charset rule disables the @charset.)
[2008-12-09] Other known vendor prefixes are: -xv-, -ah-, prince-, -webkit-, and -khtml-.
[2007-11-14] In the second bullet, change
to [a-z0-9][a-zA-Z0-9]
; in the
third bullet, change
to
[0-9a-f][0-9a-fA-F]
.
Although the preceding bullet already says that CSS is case-insensitive, the explicit mention of upper and lower case letters helps avoid mistakes.
[2008-03-05] CSS is now case-sensitive, except for certain parts:
All CSS syntax is case-insensitive within the ASCII range (i.e. [a-z] and [A-Z] are equivalent), except for parts that are not under the control of CSS.
[2008-12-02] The pair “*/” ends a comment, even if preceded by a backslash. Change this sentence in the third bullet:
Except within CSS comments, any character (except a hexadecimal digit) can be escaped with a backslash to remove its special meaning.
[2009-04-15] Text added to match the grammar:
[…] any character (except a hexadecimal digit , linefeed, carriage return or form feed) can be escaped […]
[2009-04-15] Clarified that unknown statements are ignored when looking for @import:
CSS 2.1 user agents must ignore any '@import' rule that occurs inside a block or after any
validnon-ignored statement other than an @charset or an @import rule.
[2008-11-26] More precise statement of what is ignored:
When a user agent can't parse the selector (i.e., it is not valid CSS 2.1), it must ignore the selector and the following declaration block (if any) as well.
[2009-04-15] Added error recovery rule for unexpected tokens at the top level:
Malformed statements. User agents must handle unexpected tokens encountered while parsing a statement by reading until the end of the statement, while observing the rules for matching pairs of (), [], {}, "", and '', and correctly handling escapes. For example, a malformed statement may contain an unexpected closing brace or at-keyword. E.g., the following lines are all ignored:
p @here {color: red} /* ruleset with unexpected at-keyword "@here" */ @foo @bar; /* at-rule with unexpected at-keyword "@bar" */ }} {{ - }} /* ruleset with unexpected right brace */ ) [ {} ] p {color: red } /* ruleset with unexpected right parenthesis */
[2008-11-26] Change “or block” as follows:
User agents must ignore an invalid at-keyword together with everything following it, up to and including the next semicolon (;),
or block ({...})the next block ({...}), or the end of the block (}) that contains the invalid at-keyword, whichever comes first.
[2008-08-19] Add recommendation about size of px:
[…] the user agent should rescale pixel values. It is recommended that the pixel unit refer to the whole number of device pixels that best approximates the reference pixel.
[2008-03-05] Insert case-sensitive
in Counters are denoted by case-sensitive
identifiers
.
[2008-04-07] Clarified ~= and |= by using the definitions from the Selectors module.
[2008-11-03] Clarified that [foo~=""] (i.e., with an empty value) will not match anything.
[2007-11-14] Replace
by tag
selectortype selector
.
[2009-04-15] The language code is case-insensitive.
[2008-11-03] Clarified text:
When the :first-letter and :first-line pseudo-elements are
combined withapplied to an element having content generated using :before and :after, they apply to the first letter or line of the element including theinserted textgenerated content.
[2008-08-19] Add “In CSS 2.1” and “See the section on parsing for when user agents must ignore @import rules” to
In CSS 2.1, any @import rules must precede all other rules (except the @charset rule, if present). See the section on parsing for when user agents must ignore @import rules.
[2008-11-26] Define what it means to import a style sheet twice and how the media list is matched. Add at the end:
In the absence of any media types, the import is unconditional. Specifying 'all' for the medium has the same effect. The import only takes effect if the target medium matches the media list.
A target medium matches a media list if one of the items in the media list is the target medium or 'all'.
Note that Media Queries [MEDIAQ] extends the syntax of media lists and the definition of matching.
When the same style sheet is imported or linked to a document in multiple places, user agents must process (or act as though they do) each link as though the link were to a separate style sheet.
[2007-11-22] Spelling error:
prece
.
ndence
[2008-11-26] Define the meaning of a media list:
Find all declarations that apply to the element and property in question, for the target media type. Declarations apply if the associated selector matches the element in question and the target medium matches the media list on all @media rules containing the declaration and on all links on the path through which the style sheet was reached.
[2008-12-02] The rules for parsing unknown statements inside @media blocks were ambiguous. Change the first sentence as follows:
An @media rule specifies the target media types (separated by commas) of a set of
rulesstatements (delimited by curly braces). Invalid statements must be ignored per 4.1.7 "Rule sets, declaration blocks, and selectors" and 4.2 "Rules for handling parsing errors."
Also make it explicit that CSS level 2 (unlike higher levels) has no nested @-rules. Add at the end of the section: “At-rules inside @media are invalid in CSS 2.1.”
[2008-08-18] In bullet 6, sub-bullet 2, the position of the top border edge is determined by assuming the element has a non-zero bottom (not: top) border.
[2009-02-02] Rephrased the rule for adjoining margins so that the 'min-height' and 'max-height' of an element have no influence over whether the element's bottom margin is adjoining to its last child's bottom margin.
[2008-12-02] Not only elements with 'overflow' other than 'visible', but all block formatting contexts avoid collapsing their margins with their children. Change the third bullet as follows:
- Vertical margins of elements
with 'overflow' other than 'visible'that establish new block formatting contexts (such as floats and elements with 'overflow' other than 'visible') do not collapse with their in-flow children.
[2008-12-02] Added missing 'inline-block' in: “Several values of the 'display' property make an element inline: 'inline', 'inline-table', 'inline-block' and 'run-in' (part of the time; see run-in boxes).”
[2008-04-07] Clarified that 'display: none' also applies to non-visual media.
[2008-08-19] Remove true but confusing note (occurs 4×):
Note: For absolutely positioned elements whose containing block is based on a block-level element, this property is an offset from the padding edge of that element.
[2008-08-19] Positioned descendants of a float are in the stacking context of the float's parent. Add “positioned elements and” to
[…] except that any positioned elements and elements that actually create new stacking contexts take part in the float's parent's stacking context.
Same change in Section 9.9 Layered presentation:
[…] except that any positioned elements and any elements that actually create new stacking contexts take part in the parent stacking context.”
[2008-12-02] Remove “'s” that
may be misinterpreted: “the float's parent's stacking
context.”
[2009-02-02] Add an example of negative clearance after the first note.
[2008-11-03] Added:
Boxes with fixed position that are larger than the page box are clipped. Parts of the fixed position box that are not visible in the initial containing block will not print.
[2008-12-02] The list of stacking levels is ambiguous: relatively positioned elements could fall under items 3/4/5 or under item 6. Meant is item 6, so exclude them from 3/4/5 as follows:
- the background and borders of the element forming the stacking context.
- the stacking contexts of descendants with negative stack levels.
- a stacking level containing in-flow non-inline-level non-positioned descendants.
- a stacking level for non-positioned floats and their contents.
- a stacking level for in-flow inline-level non-positioned descendants.
- a stacking level for positioned descendants with 'z-index: auto', and any descendant stacking contexts with 'z-index: 0'.
- the stacking contexts of descendants with positive stack levels.
[2009-02-02] Rephrase first bullet point to make easier to read:
The containing block in which the root element lives is a rectangle with the dimensions of the viewport, anchored at the canvas origin for continuous media, and the page area for paged media. This containing block is called the initial containing block.
The containing block in which the root element lives is a rectangle called the initial containing block. For continuous media, it has the dimensions of the viewport and is anchored at the canvas origin; it is the page area for paged media.
[2009-04-15] The values of 'left' and 'right' are only determined by section 9.4.3 in the case of relatively positioned elements:
For Points 1-6 and 9-10, the values of 'left' and 'right'
used for layoutin the case of relatively positioned elements are determined by the rules in section 9.4.3.
[2009-04-15] The only case in which 'left' or 'right' can be 'auto' is when the element is statically positioned. In that case 'left' and 'right are ignored and there is thus no need to determine a used value:
A computed value of 'auto' for
'left', 'right','margin-left' or 'margin-right' becomes a used value of '0'.
[2007-11-14] Add the following paragraph:
Otherwise, if 'width' has a computed value of 'auto', and the element has an intrinsic width, then that intrinsic width is the used value of 'width'.
just before the paragraph beginning Otherwise, if 'width' has a
computed value of 'auto', but none of the conditions above are met,
[…]
.
[2008-03-05] Change the last paragraph as follows:
If it does,
then a percentage intrinsic width on that element can't be resolved and the element is assumed to have no intrinsic widththen the resulting layout is undefined in CSS2.1.
[2008-03-05] Scrollbar widths are no longer included in the containing block width. Remove scrollbar width from:
'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right'
+ scrollbar width (if any)= width of containing block
and from:
If 'width' is not 'auto' and 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width'
+ scrollbar width (if any)[...]
and remove the paragraph:
The "scrollbar width" value is only relevant if the user agent uses a scrollbar as its scrolling mechanism. See the definition of the 'overflow' property.
[2008-03-05] Scrollbar widths are no longer included in the containing block width. Remove scrollbar width from:
'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right'
+ scrollbar width (if any)= width of containing block
and remove the paragraph:
The "scrollbar width" value is only relevant if the user agent uses a scrollbar as its scrolling mechanism. See the definition of the 'overflow' property.
[2008-03-05] Add the following definition.
[2008-08-19] Add the following note to that definition.
The static-position containing block is the containing block of a hypothetical box that would have been the first box of the element if its specified 'position' property had been 'static' and its 'float' had been 'none'. (Note that due to the rules in section 9.7 this hypothetical calculation might require also assuming a different computed value for 'display'.)
And change which 'direction' property is used as follows (two occurrences):
[...] if the 'direction' property of the element establishing the static-position containing block is [...]
[2008-03-05] Change bullet 2 as follows:
[...] if the 'direction' property of the element establishing the static-position containing block is [...]
[2008-03-05] Clarification. Replace
This situation is similar to the previous one, except that the element has an intrinsic width. The sequence of substitutions is now:
by
In this case, section 10.3.7 applies up through and including the constraint equation, but the rest of section 10.3.7 is replaced by the following rules:
[2008-04-07] Clarified that margins are not calculated as for inline elements.
Under “<percentage>,” add the same note as under “<percentage>,” in section 10.2 (“Content width: the 'width' property”).
[2007-11-14] Add the following paragraph:
Otherwise, if 'height' has a computed value of 'auto', and the element has an intrinsic height, then that intrinsic height is the used value of 'height'.
just before the paragraph beginning Otherwise, if 'height' has a
computed value of 'auto', but none of the conditions above are
met […]
.
[2008-11-26] The static position is determined considering neither float nor clear. Add this:
[…] and its specified 'float' had been 'none' and 'clear' had been 'none'.
[2008-04-07] Clarified that margins are not calculated as for inline elements.
[2007-11-14] In the Note under
'vertical-align', remove slightly
from Values of
this property have
slightly different meanings in the
context of tables.
[2008-03-05] Scrollbar widths are no longer included in the containing block width. Replace
The space taken up by the scrollbars affects the computation of the dimensions in the rendering model.
by
Any space taken up by the scrollbars should be taken out of (subtracted from the dimensions of) the containing block formed by the element with the scrollbars.
[2008-11-03] 'Overflow' on BODY is special
not only in HTML but also in XHTML. Change the sentence
“HTML UAs must instead apply the 'overflow' property from
the BODY element to the viewport, if the value on the HTML element is
'visible'.” to:
When the root element is an HTML "HTML" element or an XHTML "html" element, and that element has an HTML "BODY" element or an XHTML "body" element as a child, user agents must instead apply the 'overflow' property from the first such child element to the viewport, if the value on the root element is 'visible'.
[2008-03-05] Insert (but not a
combination)
in User agents must support separation with
commas, but may also support separation without commas (but not a
combination)
.
[2009-04-15] (And also in section 12.4:) certain keywords, in particular 'none', 'inherit' and 'initial' (the latter being reserved for future use) cannot be used as names for counters.
[2008-03-05] Error in example. Replace hebrew by lower-greek:
BLOCKQUOTE:after { content: " [" counter(bq,hebrewlower-greek) "]" }
[2008-12-01] Change “in” to “with respect to” in
The list properties describe basic visual formatting of lists: they allow style sheets to specify the marker type (image, glyph, or number), and the marker position
inwith respect to the principal box (outside it or within it before content).
because the marker is, as the rest of the sentence itself makes clear, not necessarily in the principal box.
[2008-04-07] The size of list style markers without an intrinsic size is now defined.
[2008-12-01] CSS 2.1 does not specify the position of the list item marker, but does require it to be on the left or right of the content. Also, the marker is not affected by 'overflow', but may influence the height of the principal box. Add to the definition of 'outside':
… but does require that for list items whose 'direction' property is 'ltr' the marker box be on the left side of the content and for elements whose 'direction' property is 'rtl' the marker box be on the right side of the content. 'overflow' on the element does not clip the marker box. The marker box is fixed with respect to the principal block box's border and does not scroll with the principal block box's content. The size or contents of the marker box may affect the height of the principal block box and/or the height of its first line box, and in some cases may cause the creation of a new line box. Note: This interaction may be more precisely defined in a future level of CSS.
[2009-04-015] Meaning of 'none' for 'list-style' was only defined by an example.
[2008-08-19] Add rules for drawing canvas to:
- The page area. The page area includes the boxes laid out on that page. The edges of the first page area establish the rectangle that is the initial containing block of the document. The canvas background is painted within and covers the page area.
- The margin area, which surrounds the page area. The page margin area is transparent.
[2009-02-02]
Remove sections 13.2.1.1 and 13.2.1.2. (The described situations cannot occur in CSS 2.1, because CSS 2.1 doesn't have a 'size' property.)
[2008-11-03] Clarified what locations are inconvenient for printing:
When formatting content in the page model, some content may end up outside the current page box. For example, an element whose 'white-space' property has the value 'pre' may generate a box that is wider than the page box. As another example, when boxes are positioned absolutely or relatively, they may end up in “inconvenient” locations. For example, images may be placed on the edge of the page box or 100,000 meters below the page box.
[2008-04-30] The 'page-break-inside' property no longer inherits.
[2008-12-01] UAs may apply 'page-break-before', 'page-break-after' and 'page-break-inside' to other elements than block-level ones.
[2009-02-02] “Paragraph” is not
a defined term. Change of a paragraph to in a block
element (twice).
[2009-04-15] 'Widows' and 'orphans' only accept positive values.
[2008-04-30] The 'page-break-inside' property of all ancestors is checked for page-breaking restrictions, not just that of the breakpoint's parent.
[2009-02-02] Remove possible confusion:
Rule D: In addition, breaking at (2) is allowed only if the 'page-break-inside' property of the element and all its ancestors is 'auto'.
[2009-02-02] Top margins do not disappear at a page break that is forced by a 'page-break-after' or 'page-break-before'. Correct the first bullet to:
When an unforced page break occurs here, the used values of the relevant 'margin-top' and 'margin-bottom' properties are set to '0'. When a forced page break occurs here, the used value of the relevant 'margin-bottom' property is set to '0'; the relevant 'margin-top' used value may either be set to '0' or retained.
And add the following note:
Note: It is expected that CSS3 will specify that the relevant 'margin-top' applies (i.e., is not set to '0') after a forced page break.
[2009-02-02] Remove the advice to user agents to avoid breaking inside elements with borders, inside tables or inside floating elements; add the advice to avoid breaking inside replaced elements.
[2008-11-03] The 'background' property is special on BODY not only in HTML but also in XHTML.
[2009-04-15] The whole 'background' property is used for the canvas, not just the color and the image:
For documents whose root element is an HTML "HTML" element or an XHTML "html" element that has computed values of 'transparent' for 'background-color' and 'none' for 'background-image', user agents must instead use the computed value of
thosethe background properties from that element's first HTML "BODY" element or XHTML "body" element child […]
[2008-04-07] The size of background images without an intrinsic size is now defined.
[2008-11-26] Remove incorrect text:
- 'bolder' selects the next weight that is assigned to a font that is darker than the inherited one.
If there is no such weight, it simply results in the next darker numerical value (and the font remains unchanged), unless the inherited value was '900' in which case the resulting weight is also '900'.- 'lighter' is similar, but works in the opposite direction: it selects the next lighter keyword with a different font from the inherited one,
unless there is no such font, in which case it selects the next lighter numerical value (and keeps the font unchanged).
and:
The computed value of "font-weight" is either:
one of the legal number values, orone of the legal number values combined with one or more of the relative values (bolder or lighter). This type of computed values is necessary to use when the font in question does not have all weight variations that are needed.
And instead add this note:
Note: A set of nested elements that mix 'bolder' and 'lighter' will give unpredictable results depending on the UA, OS, and font availability. This behavior will be more precisely defined in CSS3.
[2008-08-19] Remove rules about generated text from:
The following examples show what whitespace behavior is expected from the PRE and P elements, the “nowrap” attribute in HTML,
and in generated content.pre { white-space: pre } p { white-space: normal } td[nowrap] { white-space: nowrap }:before,:after { white-space: pre-line }
[2009-02-02] Collapsing of white space does not remove any line breaking oppportunities. Add the following clarification:
Then, the entire block is rendered. Inlines are laid out, taking bidi reordering into account, and wrapping as specified by the 'white-space' property. When wrapping, line breaking opportunities are determined based on the text prior to the white space collapsing steps above.
[2007-11-14] Spelling error:
boxes
.
s
[2008-10-13] Added new rule after bullet 4:
5. If a child T of a 'table', 'inline-table', 'table-row-group', 'table-header-group', 'table-footer-group', or 'table-row' box is an anonymous inline box that contains only white space, then it is treated as if it has 'display: none'.
[2009-02-02] The anonymous block containing the table and its caption establishes a block formatting context:
The anonymous box is a 'block' box if the table is block-level, and an 'inline-block' box if the table is inline-level
except that this block is never considered as a block for 'run-in' interaction, and thatThe anonymous box establishes a block formatting context. The table box (not the anonymous box) is used when doing baseline vertical alignment for an 'inline-table'.
The diagram now shows the caption's margins inside the anonymous box.
[2008-04-07] Clarification:
The horizontal alignment of a cell's inline content within a cell box
iscan be specifiedwith the 'text-align' propertyby the value of the 'text-align' property on the cell.
[2008-04-07] The size of cursors without an intrinsic size is now defined.
[2007-11-14] Spelling error: change
to ?likÇelik
(2×).
[2008-08-19] Replace
br:before { content: "\A" } :before, :after { white-space: pre-line }
with
br:before { content: "\A"; white-space: pre-line }
[2008-08-19] Add tr to:
td, th, tr { vertical-align: inherit }
[2007-11-14] Replace but any descendants
which actually create a new stacking context
by but any
positioned descendants and descendants which actually
create a new stacking context
.
[2007-09-27] Change the last S
in
the grammar rule for combinator
to
S+
:
combinator : PLUS S* | GREATER S* | S+
and remove the rule
{s}+\/\*[^*]*\*+([^/*][^*]*\*+)*\/ {unput(' '); /*replace by space*/}
in the tokenizer. The resulting language is the same, but the grammar is easier to read and relies less on specific notations of Flex.
[2007-09-27] Changes to remove ambiguity with respect to the S token and avoid nullable non-terminals.
[2007-09-27] Change the tokenizer rule
@{C}{H}{A}{R}{S}{E}{T}{return CHARSET_SYM;}
to
"@charset " {return CHARSET_SYM;}
The @charset must be in lowercase and must have a space after it (as defined in section 4.4 CSS style sheet representation).
[2008-03-05] Change the tokenizer rules
"url("{w}{string}{w}")" {return URI;}"url("{w}{url}{w}")" {return URI;}
to
{U}{R}{L}"("{w}{string}{w}")" {return URI;} {U}{R}{L}"("{w}{url}{w}")" {return URI;}
[2008-04-07] The definition of the macro
“O” is wrong. The letters O
and o can be written with hexadecimal escapes as
“\4f
” and “\6f
”
respectively (not as “\51
” and
“\71
”). The macro should therefore be
O o|\\0{0,4}(4f|6f)(\r\n|[ \t\r\n\f])?|\\o
“The two occurrences of "\377"…”: There is in fact only one occurrence.
Add a TITLE attribute to all links and which is equal to the lemma.