Quirks Mode Standard

# Quirks Mode

## Living Standard — Last Updated 1 January 1970

Participate:
  GitHub whatwg/quirks (new issue, open issues)
  IRC: #whatwg on Freenode
Commits:
  GitHub whatwg/quirks/commits
  [SNAPSHOT-LINK]
  @quirksstandard
Tests:
  web-platform-tests quirks/ (ongoing work)

## Abstract

Quirks Mode defines quirks in CSS and Selectors that are necessary to support for Web browsers for compatibility with the Web.

## 1. Introduction

### 1.1. History

Browsers have several rendering modes to render HTML documents. The reason for this is basically a historical accident. The CSS specification was incompatible with the behavior of existing browsers which existing Web content relied on. In order to comply with the specification while not breaking existing content, browsers introduced a new rendering mode (no-quirks mode). Some browsers still had the shrink-wrapping behavior for images in table cells in their no-quirks mode, and sites started relying on that, so browsers that implemented the specification’s behavior introduced a third mode (limited-quirks mode). In hindsight, it would have been better to make the default CSS behavior be compatible with what the existing content relied on and providing opt-ins to different behavior. The different modes have since gained a few differences outside of CSS.

### 1.2. Goals

- Create a specification for rendering old (or indeed new, if they happen to have a particular pragma) HTML documents.

  The HTML specification defines when a document is set to quirks mode, limited-quirks mode or no-quirks mode. [HTML]

- Remove quirks from implementations that are not needed for Web compatibility.

  For example, Gecko has removed a quirk about list item bullet size, and Chromium has removed a quirk where display was forced to table or inline-table on `table` elements.

- Get interoperability on quirks that are needed for Web compatibility.

  For example, Gecko aligned their implementation of the :active and :hover quirk with this specification and thereby achieved closer interoperability with other browsers.

- Where possible, limit quirks to a fixed set of legacy features so they don’t propagate into new features.

  For example, quirky colors are limited to a fixed set of CSS properties so that they do not apply in SVG features that also accept colors, or in CSS gradients where the grammar could otherwise become ambiguous.

This specification does not enumerate all quirks that currently exist in browsers. A number of quirks are specified in HTML, DOM, CSSOM and CSSOM View. [HTML] [DOM] [CSSOM] [CSSOM-VIEW] If a quirk is not specified anywhere, it is probably due to the second bullet point above.

## 2. Common infrastructure

### 2.1. Conformance

All diagrams, examples, and notes in this specification are non-normative, as are all sections explicitly marked non-normative. Everything else in this specification is normative.

The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this specification are to be interpreted as described in RFC2119. For readability, these words do not appear in all uppercase letters in this specification. [RFC2119]

### 2.2. Terminology

When this specification refers to a "`foo` element", it means an element with the local name foo and having the namespace `http://www.w3.org/1999/xhtml`.

When this specification refers to a "`foo` attribute", it means an attribute with the local name foo and having no namespace.

The document’s body element is the first child of the document element that is a `body` element, if there is one, and the document element is an `html` element. Otherwise it is null.

The document’s body element is different from HTML’s the body element, since the latter can be a `frameset` element.

## 3. CSS

### 3.1. The hashless hex color quirk

Quirky colors are denoted by <quirky-color>. A quirky color corresponds to a <number-token>, a <dimension-token> or an <ident-token> component value in the syntax. The value of a quirky color is obtained from the possible component values using the following algorithm, aborting on the first step that returns a value:

1. Let cv be the component value.

2. If cv is a <number-token> or a <dimension-token>, follow these substeps:

   1. If cv’s type flag is not "integer", return an error.

      This means that values that happen to use scientific notation, e.g., `5e5e5e`, will fail to parse.

   2. If cv’s value is less than zero, return an error.

   3. Let serialization be the serialization of cv’s value, as a base-ten integer using digits 0-9 (U+0030 to U+0039) in the shortest form possible.

   4. If cv is a <dimension-token>, append the unit to serialization.

   5. If serialization consists of fewer than six characters, prepend zeros (U+0030) so that it becomes six characters.

3. Otherwise, cv is an <ident-token>; let serialization be cv’s value.

4. If serialization does not consist of three or six characters, return an error.

5. If serialization contains any characters not in the range [0-9A-Fa-f] (U+0030 to U+0039, U+0041 to U+0046, U+0061 to U+0066), return an error.

6. Return the concatenation of "`#`" (U+0023) and serialization.

If the value of a quirky color is an error, it is an illegal value. Otherwise, the value of a quirky color must be interpreted as an RGB value in hexadecimal notation using the same rules as for <color>.

In quirks mode, the following properties must have their "Value" grammar changed by replacing <color> with:

    [ <color> | <quirky-color> ]

- background-color
- border-color
- border-top-color
- border-right-color
- border-bottom-color
- border-left-color
- color

Any property not listed above must not support <quirky-color> even if it references one of the above properties in its "Value" grammar.

This quirk must apply inside an @supports at-rule.

The <quirky-color> value must not be supported in arguments to CSS expressions, and must not be supported in the `supports()` static method of the `CSS` interface.

### 3.2. The unitless length quirk

Quirky lengths are denoted by <quirky-length>. A quirky length is a number and corresponds to a <number-token> component value in the syntax. The value of a quirky length is obtained from the component value’s value.

The value of a quirky length must be interpreted as a <length> where the unit is px.

In quirks mode, the following properties must have their "Value" grammar changed by replacing <length> with:

    [ <length> | <quirky-length> ]

- background-position
- border-spacing
- border-top-width
- border-right-width
- border-bottom-width
- border-left-width
- border-width
- bottom
- clip
- font-size
- height
- left
- letter-spacing
- margin-right
- margin-left
- margin-top
- margin-bottom
- margin
- max-height
- max-width
- min-height
- min-width
- padding-top
- padding-right
- padding-bottom
- padding-left
- padding
- right
- text-indent
- top
- vertical-align
- width
- word-spacing

Any property not listed above must not support <quirky-length> even if it references one of the above properties in its "Value" grammar.

This quirk must apply inside an @supports at-rule.

The <quirky-length> value must not be supported in arguments to CSS expressions other than the rect() expression, and must not be supported in the `supports()` static method of the `CSS` interface.

### 3.3. The line height calculation quirk

In quirks mode and limited-quirks mode, an inline box that matches the following conditions, must, for the purpose of line height calculation, act as if the box had a line-height of zero.

- The border-top-width, border-bottom-width, padding-top and padding-bottom properties have a used value of zero and the box has a vertical writing mode, or the border-right-width, border-left-width, padding-right and padding-left properties have a used value of zero and the box has a horizontal writing mode.

- It either contains no text or it contains only collapsed whitespace.

### 3.4. The blocks ignore line-height quirk

In quirks mode and limited-quirks mode, for a block container element whose content is composed of inline-level elements, the element’s line-height must be ignored for the purpose of calculating the minimal height of line boxes within the element.

This means that the "strut" is not created.

### 3.5. The percentage height calculation quirk

In quirks mode, for the purpose of calculating the height of an element element, if the computed value of the position property of element is relative or static, the specified value for the height property of element is a <percentage>, and element does not have a computed value of the display property that is table-row, table-row-group, table-header-group, table-footer-group, table-cell or table-caption, the containing block of element must be calculated using the following algorithm, aborting on the first step that returns a value:

1. Let element be the nearest ancestor containing block of element, if there is one. Otherwise, return the initial containing block.

2. If element has a computed value of the display property that is table-cell, then return a UA-defined value.

3. If element has a computed value of the height property that is not auto, then return element.

4. If element has a computed value of the position property that is absolute, or if element is a not a block container or a table wrapper box, then return element.

5. Jump to the first step.

It is at the time or writing undefined how percentage heights inside tables work in CSS. This specification does not try to specify what to use as the containing block for calculating percentage heights in tables. Godspeed!

This quirk needs to take writing modes into account.

### 3.6. The `html` element fills the viewport quirk

In quirks mode, if the document element element matches the following conditions:

- element is an `html` element.

- The computed value of the width property of element is auto and element has a vertical writing mode, or the computed value of the height property of element is auto and element has a horizontal writing mode. [CSS-WRITING-MODES-3]

...then element must have its border box size in the block flow direction set using the following algorithm:

1. Let margins be sum of the used values of the margin-left and margin-right properties of element if element has a vertical writing mode, otherwise let margins be the sum of the used values of the margin-top and margin-bottom properties of element.

2. Let size be the size of the initial containing block in the block flow direction minus margins.

3. Return the bigger value of size and the normal border box size the element would have according to the CSS specification.

### 3.7. The `body` element fills the `html` element quirk

In quirks mode, if the document’s body element body is not null and if it matches the following conditions:

- The computed value of the width property of body is auto and body has a vertical writing mode, or the computed value of the height property of body is auto and body has a horizontal writing mode. [CSS-WRITING-MODES-3]

- The computed value of the position property of body is not absolute or fixed.

- The computed value of the float property of body is none.

- body is not an inline-level element.

- body is not a spanning element. [CSS3-MULTICOL]

...then body must have its border box size in the block flow direction set using the following algorithm:

1. Let margins be the sum of the used values of the margin-left and margin-right properties of body if body has a vertical writing mode, otherwise let margins be the sum of the used values of the margin-top and margin-bottom properties of body.

2. Let size be the size of body’s parent element’s content box in the block flow direction minus margins.

3. Return the bigger value of size and the normal border box size the element would have according to the CSS specification.

What should happen if the `html` and the `body` have different writing modes?

### 3.8. The table cell width calculation quirk

In quirks mode, for the purpose of calculating the min-content width of an inline formatting context for which a table cell cell is the containing block, if cell has a computed value of the width property that is auto, `img` elements that are inline-level replaced elements in that inline formatting context must not have a soft wrap opportunity before or after them. [CSS-TEXT-3] [INTRINSIC]

### 3.9. The table cell nowrap minimum width calculation quirk

In quirks mode, an element cell that matches the following conditions must act as if it had an outer min-content width of a table cell in the automatic table layout algorithm that is the bigger value of cell’s computed value of the width property and the outer min-content width of a table cell. [INTRINSIC]

- cell is a `td` element or a `th` element.

- cell has a `nowrap` attribute.

- The computed value of the width property of cell is a <length> that is not zero.

### 3.10. The collapsing table quirk

In quirks mode, an element table that matches the following conditions must have a used value of the height property of 0 and a used value of the border-style property of none.

- table has a computed value of the display property that is table.

- table has no child table-row-group, table-header-group, table-footer-group or table-caption box.

- table has no child table-column-group box that itself has a child table-column box.

### 3.11. The text decoration doesn’t propagate into tables quirk

In quirks mode, text decoration must not propagate into `table` elements.

### 3.12. The tables inherit color from body quirk

In quirks mode, the initial value of the color property must be quirk-inherit, a special value that has no keyword mapping to it.

The computed value of the color property of an element element must be calculated using the following algorithm:

1. If the specified value of the color property of element is not quirk-inherit, jump to the last step.

2. If element is not a `table` element, jump to the last step.

3. If the document’s body element is null, jump to the last step.

4. Return the used value of the color property of the document’s body element. Abort these steps.

5. If the specified value of the color property of element is quirk-inherit, let the specified value of the color property of element be the initial value of the color property according to the CSS specification. Return the computed value of the color property of element as specified in the CSS specification.

### 3.13. The table cell height box sizing quirk

In quirks mode, elements that have a computed value of the display property of table-cell must act as they have used value of the box-sizing property of border-box, but only for the purpose of the height, min-height and max-height properties.

## 4. Selectors

The following test appears to be invalid. See chromium issue 733682.

### 4.1. The :active and :hover quirk

In quirks mode, a compound selector selector that matches the following conditions must not match elements that would not also match the :any-link selector. [SELECTORS4]

- selector uses the :active or :hover pseudo-classes.

- selector does not use a type selector.

- selector does not use an attribute selector.

- selector does not use an ID selector.

- selector does not use a class selector.

- selector does not use a pseudo-class selector other than :active and :hover.

- selector does not use a pseudo-element selector.

- selector is not part of an argument to a functional pseudo-class or pseudo-element.

## Security and Privacy Considerations

There are no known security or privacy impacts in this specification.

## Acknowledgments

Thanks to Anne van Kesteren, Boris Zbarsky, Chris Rebert, Dan Mulvey, David Baron, Kang-Hao Lu, Ms2ger, Simon Sapin, and Tab Atkins for their useful comments.

Special thanks to Boris Zbarsky and David Baron for documenting Mozilla’s quirks in MDN.

This standard is written by Simon Pieters (Bocoup, zcorpan@gmail.com).

Copyright © 1970 WHATWG (Apple, Google, Mozilla, Microsoft). This work is licensed under a Creative Commons Attribution 4.0 International License.

## Index

### Terms defined by this specification

- document’s body element, in §2.2
- <quirky-color>, in §3.1
- quirky color, in §3.1
- <quirky-length>, in §3.2
- quirky length, in §3.2

https://drafts.csswg.org/css-backgrounds-3/#propdef-background-color Referenced in:

- 3.1. The hashless hex color quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-background-position Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-bottom-color Referenced in:

- 3.1. The hashless hex color quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-bottom-width Referenced in:

- 3.2. The unitless length quirk
- 3.3. The line height calculation quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-color Referenced in:

- 3.1. The hashless hex color quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-left-color Referenced in:

- 3.1. The hashless hex color quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-left-width Referenced in:

- 3.2. The unitless length quirk
- 3.3. The line height calculation quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-right-color Referenced in:

- 3.1. The hashless hex color quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-right-width Referenced in:

- 3.2. The unitless length quirk
- 3.3. The line height calculation quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-style Referenced in:

- 3.10. The collapsing table quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-top-color Referenced in:

- 3.1. The hashless hex color quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-top-width Referenced in:

- 3.2. The unitless length quirk
- 3.3. The line height calculation quirk

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-width Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-backgrounds-3/#valdef-line-style-none Referenced in:

- 3.10. The collapsing table quirk

https://drafts.csswg.org/css-box-3/#propdef-margin Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-box-3/#propdef-margin-bottom Referenced in:

- 3.2. The unitless length quirk
- 3.6. The html element fills the viewport quirk
- 3.7. The body element fills the html element quirk

https://drafts.csswg.org/css-box-3/#propdef-margin-left Referenced in:

- 3.2. The unitless length quirk
- 3.6. The html element fills the viewport quirk
- 3.7. The body element fills the html element quirk

https://drafts.csswg.org/css-box-3/#propdef-margin-right Referenced in:

- 3.2. The unitless length quirk
- 3.6. The html element fills the viewport quirk
- 3.7. The body element fills the html element quirk

https://drafts.csswg.org/css-box-3/#propdef-margin-top Referenced in:

- 3.2. The unitless length quirk
- 3.6. The html element fills the viewport quirk
- 3.7. The body element fills the html element quirk

https://drafts.csswg.org/css-box-3/#propdef-padding Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-box-3/#propdef-padding-bottom Referenced in:

- 3.2. The unitless length quirk
- 3.3. The line height calculation quirk

https://drafts.csswg.org/css-box-3/#propdef-padding-left Referenced in:

- 3.2. The unitless length quirk
- 3.3. The line height calculation quirk

https://drafts.csswg.org/css-box-3/#propdef-padding-right Referenced in:

- 3.2. The unitless length quirk
- 3.3. The line height calculation quirk

https://drafts.csswg.org/css-box-3/#propdef-padding-top Referenced in:

- 3.2. The unitless length quirk
- 3.3. The line height calculation quirk

https://drafts.csswg.org/css-cascade-4/#computed-value Referenced in:

- 3.5. The percentage height calculation quirk (2) (3) (4) (5)
- 3.6. The html element fills the viewport quirk (2)
- 3.7. The body element fills the html element quirk (2) (3) (4)
- 3.8. The table cell width calculation quirk
- 3.9. The table cell nowrap minimum width calculation quirk (2)
- 3.10. The collapsing table quirk
- 3.12. The tables inherit color from body quirk (2)
- 3.13. The table cell height box sizing quirk

https://drafts.csswg.org/css-cascade-4/#used-value Referenced in:

- 3.3. The line height calculation quirk (2)
- 3.6. The html element fills the viewport quirk (2)
- 3.7. The body element fills the html element quirk (2)
- 3.10. The collapsing table quirk (2)
- 3.12. The tables inherit color from body quirk
- 3.13. The table cell height box sizing quirk

https://drafts.csswg.org/css-color-3/#valuea-def-color Referenced in:

- 3.1. The hashless hex color quirk (2) (3)

https://drafts.csswg.org/css-color-4/#propdef-color Referenced in:

- 3.1. The hashless hex color quirk
- 3.12. The tables inherit color from body quirk (2) (3) (4) (5) (6) (7) (8)

https://drafts.csswg.org/css-conditional-3/#at-ruledef-supports Referenced in:

- 3.1. The hashless hex color quirk
- 3.2. The unitless length quirk

https://drafts.csswg.org/css-conditional-3/#dom-css-supports Referenced in:

- 3.1. The hashless hex color quirk
- 3.2. The unitless length quirk

https://drafts.csswg.org/css-display-3/#block-container Referenced in:

- 3.5. The percentage height calculation quirk

https://drafts.csswg.org/css-display-3/#containing-block Referenced in:

- 3.5. The percentage height calculation quirk (2)
- 3.8. The table cell width calculation quirk

https://drafts.csswg.org/css-display-3/#propdef-display Referenced in:

- 3.5. The percentage height calculation quirk (2)
- 3.10. The collapsing table quirk
- 3.13. The table cell height box sizing quirk

https://drafts.csswg.org/css-display-3/#initial-containing-block Referenced in:

- 3.5. The percentage height calculation quirk
- 3.6. The html element fills the viewport quirk

https://drafts.csswg.org/css-display-3/#inline-formatting-context Referenced in:

- 3.8. The table cell width calculation quirk

https://drafts.csswg.org/css-display-3/#inline-level Referenced in:

- 3.4. The blocks ignore line-height quirk
- 3.7. The body element fills the html element quirk
- 3.8. The table cell width calculation quirk

https://drafts.csswg.org/css-display-3/#valdef-display-table Referenced in:

- 3.10. The collapsing table quirk

https://drafts.csswg.org/css-display-3/#valdef-display-table-caption Referenced in:

- 3.5. The percentage height calculation quirk
- 3.10. The collapsing table quirk

https://drafts.csswg.org/css-display-3/#valdef-display-table-cell Referenced in:

- 3.5. The percentage height calculation quirk (2)
- 3.13. The table cell height box sizing quirk

https://drafts.csswg.org/css-display-3/#valdef-display-table-column Referenced in:

- 3.10. The collapsing table quirk

https://drafts.csswg.org/css-display-3/#valdef-display-table-column-group Referenced in:

- 3.10. The collapsing table quirk

https://drafts.csswg.org/css-display-3/#valdef-display-table-footer-group Referenced in:

- 3.5. The percentage height calculation quirk
- 3.10. The collapsing table quirk

https://drafts.csswg.org/css-display-3/#valdef-display-table-header-group Referenced in:

- 3.5. The percentage height calculation quirk
- 3.10. The collapsing table quirk

https://drafts.csswg.org/css-display-3/#valdef-display-table-row Referenced in:

- 3.5. The percentage height calculation quirk

https://drafts.csswg.org/css-display-3/#valdef-display-table-row-group Referenced in:

- 3.5. The percentage height calculation quirk
- 3.10. The collapsing table quirk

https://drafts.csswg.org/css-fonts-3/#propdef-font-size Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-inline-3/#propdef-vertical-align Referenced in:

- 3.2. The unitless length quirk

https://drafts.fxtf.org/css-masking-1/#propdef-clip Referenced in:

- 3.2. The unitless length quirk

https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-page-floats-3/#valdef-float-none Referenced in:

- 3.7. The body element fills the html element quirk

https://drafts.csswg.org/css-position-3/#valdef-position-absolute Referenced in:

- 3.5. The percentage height calculation quirk
- 3.7. The body element fills the html element quirk

https://drafts.csswg.org/css-position-3/#propdef-bottom Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-position-3/#valdef-position-fixed Referenced in:

- 3.7. The body element fills the html element quirk

https://drafts.csswg.org/css-position-3/#propdef-left Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-position-3/#propdef-position Referenced in:

- 3.5. The percentage height calculation quirk (2)
- 3.7. The body element fills the html element quirk

https://drafts.csswg.org/css-position-3/#valdef-position-relative Referenced in:

- 3.5. The percentage height calculation quirk

https://drafts.csswg.org/css-position-3/#propdef-right Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-position-3/#valdef-position-static Referenced in:

- 3.5. The percentage height calculation quirk

https://drafts.csswg.org/css-position-3/#propdef-top Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-sizing-3/#valdef-width-auto Referenced in:

- 3.5. The percentage height calculation quirk
- 3.6. The html element fills the viewport quirk (2)
- 3.7. The body element fills the html element quirk (2)
- 3.8. The table cell width calculation quirk

https://drafts.csswg.org/css-sizing-3/#valdef-box-sizing-border-box Referenced in:

- 3.13. The table cell height box sizing quirk

https://drafts.csswg.org/css-sizing-3/#propdef-box-sizing Referenced in:

- 3.13. The table cell height box sizing quirk

https://drafts.csswg.org/css-syntax-3/#typedef-dimension-token Referenced in:

- 3.1. The hashless hex color quirk (2) (3)

https://drafts.csswg.org/css-syntax-3/#typedef-ident-token Referenced in:

- 3.1. The hashless hex color quirk (2)

https://drafts.csswg.org/css-syntax-3/#typedef-number-token Referenced in:

- 3.1. The hashless hex color quirk (2)
- 3.2. The unitless length quirk

https://drafts.csswg.org/css-syntax-3/#component-value Referenced in:

- 3.1. The hashless hex color quirk (2) (3)
- 3.2. The unitless length quirk (2)

https://drafts.csswg.org/css-tables-3/#propdef-border-spacing Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-tables-3/#table-wrapper-box Referenced in:

- 3.5. The percentage height calculation quirk

https://drafts.csswg.org/css-text-3/#propdef-letter-spacing Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-text-3/#soft-wrap-opportunity Referenced in:

- 3.8. The table cell width calculation quirk

https://drafts.csswg.org/css-text-3/#propdef-text-indent Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-text-3/#propdef-word-spacing Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-values-3/#length-value Referenced in:

- 3.2. The unitless length quirk (2) (3)
- 3.9. The table cell nowrap minimum width calculation quirk

https://drafts.csswg.org/css-values-3/#percentage-value Referenced in:

- 3.5. The percentage height calculation quirk

https://drafts.csswg.org/css-values-4/#number Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-values-4/#px Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css-values-4/#comb-one Referenced in:

- 3.1. The hashless hex color quirk
- 3.2. The unitless length quirk

https://drafts.csswg.org/css-writing-modes-4/#block-flow-direction Referenced in:

- 3.6. The html element fills the viewport quirk (2)
- 3.7. The body element fills the html element quirk (2)

https://drafts.csswg.org/css-writing-modes-4/#horizontal-writing-mode Referenced in:

- 3.3. The line height calculation quirk
- 3.6. The html element fills the viewport quirk
- 3.7. The body element fills the html element quirk

https://drafts.csswg.org/css-writing-modes-4/#vertical-writing-mode Referenced in:

- 3.3. The line height calculation quirk
- 3.6. The html element fills the viewport quirk (2)
- 3.7. The body element fills the html element quirk (2)

https://drafts.csswg.org/css2/visuren.html#block-container-element Referenced in:

- 3.4. The blocks ignore line-height quirk

https://drafts.csswg.org/css2/box.html#border-edge Referenced in:

- 3.6. The html element fills the viewport quirk (2)
- 3.7. The body element fills the html element quirk (2)

https://drafts.csswg.org/css2/box.html#content-edge Referenced in:

- 3.7. The body element fills the html element quirk

https://drafts.csswg.org/css2/visuren.html#propdef-float Referenced in:

- 3.7. The body element fills the html element quirk

https://drafts.csswg.org/css2/visudet.html#propdef-height Referenced in:

- 3.2. The unitless length quirk
- 3.5. The percentage height calculation quirk (2) (3)
- 3.6. The html element fills the viewport quirk
- 3.7. The body element fills the html element quirk
- 3.10. The collapsing table quirk
- 3.13. The table cell height box sizing quirk

https://drafts.csswg.org/css2/conform.html#illegal Referenced in:

- 3.1. The hashless hex color quirk

https://drafts.csswg.org/css2/visudet.html#propdef-line-height Referenced in:

- 3.3. The line height calculation quirk
- 3.4. The blocks ignore line-height quirk

https://drafts.csswg.org/css2/visudet.html#propdef-max-height Referenced in:

- 3.2. The unitless length quirk
- 3.13. The table cell height box sizing quirk

https://drafts.csswg.org/css2/visudet.html#propdef-max-width Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css2/visudet.html#propdef-min-height Referenced in:

- 3.2. The unitless length quirk
- 3.13. The table cell height box sizing quirk

https://drafts.csswg.org/css2/visudet.html#propdef-min-width Referenced in:

- 3.2. The unitless length quirk

https://drafts.csswg.org/css2/conform.html#replaced-element Referenced in:

- 3.8. The table cell width calculation quirk

https://drafts.csswg.org/css2/visudet.html#propdef-width Referenced in:

- 3.2. The unitless length quirk
- 3.6. The html element fills the viewport quirk
- 3.7. The body element fills the html element quirk
- 3.8. The table cell width calculation quirk
- 3.9. The table cell nowrap minimum width calculation quirk (2)

https://drafts.csswg.org/css-multicol-1/#spanning-element Referenced in:

- 3.7. The body element fills the html element quirk

https://www.w3.org/TR/cssom-1/#css Referenced in:

- 3.1. The hashless hex color quirk
- 3.2. The unitless length quirk

https://dom.spec.whatwg.org/#concept-tree-child Referenced in:

- 2.2. Terminology

https://dom.spec.whatwg.org/#document-element Referenced in:

- 2.2. Terminology (2)
- 3.6. The html element fills the viewport quirk

https://dom.spec.whatwg.org/#concept-document-limited-quirks Referenced in:

- 1.2. Goals
- 3.3. The line height calculation quirk
- 3.4. The blocks ignore line-height quirk

https://dom.spec.whatwg.org/#concept-document-no-quirks Referenced in:

- 1.2. Goals

https://dom.spec.whatwg.org/#concept-document-quirks Referenced in:

- 1.2. Goals
- 3.1. The hashless hex color quirk
- 3.2. The unitless length quirk
- 3.3. The line height calculation quirk
- 3.4. The blocks ignore line-height quirk
- 3.5. The percentage height calculation quirk
- 3.6. The html element fills the viewport quirk
- 3.7. The body element fills the html element quirk
- 3.8. The table cell width calculation quirk
- 3.9. The table cell nowrap minimum width calculation quirk
- 3.10. The collapsing table quirk
- 3.11. The text decoration doesn’t propagate into tables quirk
- 3.12. The tables inherit color from body quirk
- 3.13. The table cell height box sizing quirk
- 4.1. The :active and :hover quirk

https://html.spec.whatwg.org/multipage/sections.html#the-body-element Referenced in:

- 2.2. Terminology
- 3.7. The body element fills the html element quirk (2)

https://html.spec.whatwg.org/multipage/obsolete.html#frameset Referenced in:

- 2.2. Terminology

https://html.spec.whatwg.org/multipage/semantics.html#the-html-element Referenced in:

- 2.2. Terminology
- 3.6. The html element fills the viewport quirk (2)
- 3.7. The body element fills the html element quirk (2)

https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element Referenced in:

- 3.8. The table cell width calculation quirk

https://html.spec.whatwg.org/multipage/tables.html#the-table-element Referenced in:

- 3.11. The text decoration doesn’t propagate into tables quirk
- 3.12. The tables inherit color from body quirk

https://html.spec.whatwg.org/multipage/tables.html#the-td-element Referenced in:

- 3.9. The table cell nowrap minimum width calculation quirk

https://html.spec.whatwg.org/multipage/tables.html#the-th-element Referenced in:

- 3.9. The table cell nowrap minimum width calculation quirk

https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2 Referenced in:

- 2.2. Terminology

https://drafts.csswg.org/selectors-4/#active-pseudo Referenced in:

- 4.1. The :active and :hover quirk (2)

https://drafts.csswg.org/selectors-4/#any-link-pseudo Referenced in:

- 4.1. The :active and :hover quirk

https://drafts.csswg.org/selectors-4/#hover-pseudo Referenced in:

- 4.1. The :active and :hover quirk (2)

https://drafts.csswg.org/selectors-4/#attribute-selector Referenced in:

- 4.1. The :active and :hover quirk

https://drafts.csswg.org/selectors-4/#class-selector Referenced in:

- 4.1. The :active and :hover quirk

https://drafts.csswg.org/selectors-4/#compound Referenced in:

- 4.1. The :active and :hover quirk

https://drafts.csswg.org/selectors-4/#functional-pseudo-class Referenced in:

- 4.1. The :active and :hover quirk

https://drafts.csswg.org/selectors-4/#id-selector Referenced in:

- 4.1. The :active and :hover quirk

https://drafts.csswg.org/selectors-4/#pseudo-class Referenced in:

- 4.1. The :active and :hover quirk (2)

https://drafts.csswg.org/selectors-4/#pseudo-element Referenced in:

- 4.1. The :active and :hover quirk (2)

https://drafts.csswg.org/selectors-4/#type-selector Referenced in:

- 4.1. The :active and :hover quirk

### Terms defined by reference

- [css-backgrounds-3] defines the following terms:
  - background-color
  - background-position
  - border-bottom-color
  - border-bottom-width
  - border-color
  - border-left-color
  - border-left-width
  - border-right-color
  - border-right-width
  - border-style
  - border-top-color
  - border-top-width
  - border-width
  - none
- [css-box-3] defines the following terms:
  - margin
  - margin-bottom
  - margin-left
  - margin-right
  - margin-top
  - padding
  - padding-bottom
  - padding-left
  - padding-right
  - padding-top
- [css-cascade-4] defines the following terms:
  - computed value
  - used value
- [css-color-3] defines the following terms:
  - <color>
- [css-color-4] defines the following terms:
  - color
- [css-conditional-3] defines the following terms:
  - @supports
  - supports(property, value)
- [css-display-3] defines the following terms:
  - block container
  - containing block
  - display
  - initial containing block
  - inline formatting context
  - inline-level
  - table
  - table-caption
  - table-cell
  - table-column
  - table-column-group
  - table-footer-group
  - table-header-group
  - table-row
  - table-row-group
- [css-fonts-3] defines the following terms:
  - font-size
- [css-inline-3] defines the following terms:
  - vertical-align
- [css-masking-1] defines the following terms:
  - clip
  - rect()
- [css-page-floats-3] defines the following terms:
  - none
- [css-position-3] defines the following terms:
  - absolute
  - bottom
  - fixed
  - left
  - position
  - relative
  - right
  - static
  - top
- [css-sizing-3] defines the following terms:
  - auto
  - border-box
  - box-sizing
- [css-syntax-3] defines the following terms:
  - <dimension-token>
  - <ident-token>
  - <number-token>
  - component value
- [css-tables-3] defines the following terms:
  - border-spacing
  - table wrapper box
- [CSS-TEXT-3] defines the following terms:
  - letter-spacing
  - soft wrap opportunity
  - text-indent
  - word-spacing
- [css-values-3] defines the following terms:
  - <length>
  - <percentage>
- [css-values-4] defines the following terms:
  - number
  - px
  - |
- [css-writing-modes-4] defines the following terms:
  - block flow direction
  - horizontal writing mode
  - vertical writing mode
- [CSS2] defines the following terms:
  - block container element
  - border box
  - content box
  - float
  - height
  - illegal
  - line-height
  - max-height
  - max-width
  - min-height
  - min-width
  - replaced element
  - width
- [CSS3-MULTICOL] defines the following terms:
  - spanning element
- [CSSOM] defines the following terms:
  - CSS
- [DOM] defines the following terms:
  - child
  - document element
  - limited-quirks mode
  - no-quirks mode
  - quirks mode
- [HTML] defines the following terms:
  - body
  - frameset
  - html
  - img
  - table
  - td
  - th
  - the body element
- [SELECTORS4] defines the following terms:
  - :active
  - :any-link
  - :hover
  - attribute selector
  - class selector
  - compound selector
  - functional pseudo-class
  - id selector
  - pseudo-class
  - pseudo-element
  - type selector

## References

### Normative References

[CSS-BACKGROUNDS-3]
  Bert Bos; Elika Etemad; Brad Kemper. CSS Backgrounds and Borders Module Level 3. URL: https://drafts.csswg.org/css-backgrounds/
[CSS-BOX-3]
  Elika Etemad. CSS Box Model Module Level 3. URL: https://drafts.csswg.org/css-box-3/
[CSS-CASCADE-4]
  Elika Etemad; Tab Atkins Jr.. CSS Cascading and Inheritance Level 4. URL: https://drafts.csswg.org/css-cascade/
[CSS-COLOR-3]
  Tantek Çelik; Chris Lilley; David Baron. CSS Color Module Level 3. URL: https://drafts.csswg.org/css-color-3/
[CSS-COLOR-4]
  Tab Atkins Jr.; Chris Lilley. CSS Color Module Level 4. URL: https://drafts.csswg.org/css-color/
[CSS-CONDITIONAL-3]
  CSS Conditional Rules Module Level 3 URL: https://drafts.csswg.org/css-conditional-3/
[CSS-DISPLAY-3]
  Tab Atkins Jr.; Elika Etemad. CSS Display Module Level 3. URL: https://drafts.csswg.org/css-display/
[CSS-FONTS-3]
  John Daggett; Myles Maxfield; Chris Lilley. CSS Fonts Module Level 3. URL: https://drafts.csswg.org/css-fonts/
[CSS-INLINE-3]
  Dave Cramer; Elika Etemad; Steve Zilles. CSS Inline Layout Module Level 3. URL: https://drafts.csswg.org/css-inline-3/
[CSS-MASKING-1]
  Dirk Schulze; Brian Birtles; Tab Atkins Jr.. CSS Masking Module Level 1. URL: https://drafts.fxtf.org/css-masking-1/
[CSS-PAGE-FLOATS-3]
  Johannes Wilm. CSS Page Floats. URL: https://drafts.csswg.org/css-page-floats/
[CSS-POSITION-3]
  Rossen Atanassov; Arron Eicholz. CSS Positioned Layout Module Level 3. URL: https://drafts.csswg.org/css-position/
[CSS-SIZING-3]
  Tab Atkins Jr.; Elika Etemad. CSS Intrinsic & Extrinsic Sizing Module Level 3. URL: https://drafts.csswg.org/css-sizing-3/
[CSS-SYNTAX-3]
  Tab Atkins Jr.; Simon Sapin. CSS Syntax Module Level 3. URL: https://drafts.csswg.org/css-syntax/
[CSS-TABLES-3]
  Greg Whitworth. CSS Table Module Level 3. URL: https://drafts.csswg.org/css-tables-3/
[CSS-TEXT-3]
  Elika Etemad; Koji Ishii; Florian Rivoal. CSS Text Module Level 3. URL: https://drafts.csswg.org/css-text-3/
[CSS-VALUES-3]
  Tab Atkins Jr.; Elika Etemad. CSS Values and Units Module Level 3. URL: https://drafts.csswg.org/css-values-3/
[CSS-VALUES-4]
  Tab Atkins Jr.; Elika Etemad. CSS Values and Units Module Level 4. URL: https://drafts.csswg.org/css-values-4/
[CSS-WRITING-MODES-3]
  Elika Etemad; Koji Ishii. CSS Writing Modes Level 3. URL: https://drafts.csswg.org/css-writing-modes-3/
[CSS-WRITING-MODES-4]
  Elika Etemad; Koji Ishii. CSS Writing Modes Level 4. URL: https://drafts.csswg.org/css-writing-modes-4/
[CSS2]
  Bert Bos; et al. Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification. URL: http://dev.w3.org/csswg/css2/
[CSS3-MULTICOL]
  Florian Rivoal; Rachel Andrew. CSS Multi-column Layout Module Level 1. URL: https://drafts.csswg.org/css-multicol/
[CSSOM]
  Simon Pieters; Glenn Adams. CSS Object Model (CSSOM). URL: https://drafts.csswg.org/cssom/
[DOM]
  Anne van Kesteren. DOM Standard. Living Standard. URL: https://dom.spec.whatwg.org/
[HTML]
  Anne van Kesteren; et al. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/
[INTRINSIC]
  David Baron. More Precise Definitions of Intrinsic Widths and Table Layout (Proposal). URL: https://dbaron.org/css/intrinsic/
[RFC2119]
  S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://tools.ietf.org/html/rfc2119
[SELECTORS4]
  Elika Etemad; Tab Atkins Jr.. Selectors Level 4. URL: https://drafts.csswg.org/selectors/

### Informative References

[CSSOM-VIEW]
  Simon Pieters. CSSOM View Module. URL: https://drafts.csswg.org/cssom-view/

#documents-body-element Referenced in:

- 2.2. Terminology
- 3.7. The body element fills the html element quirk
- 3.12. The tables inherit color from body quirk (2)

#quirky-color Referenced in:

- 1.2. Goals
- 3.1. The hashless hex color quirk (2) (3) (4)

#quirky-color-value Referenced in:

- 3.1. The hashless hex color quirk (2) (3)

#quirky-length Referenced in:

- 3.2. The unitless length quirk (2) (3)

#quirky-length-value Referenced in:

- 3.2. The unitless length quirk (2) (3)