CSS Display Module Level 3

Unofficial Proposal Draft,

This version:
https://drafts.csswg.org/css-display/
Latest published version:
https://www.w3.org/TR/css-display-3/
Previous Versions:
Issue Tracking:
Inline In Spec
GitHub Issues
Editors:
Tab Atkins Jr. (Google)
Elika J. Etemad / fantasai (Invited Expert)

Abstract

This module describes how the CSS formatting box tree is generated from the document element tree and defines the display property that controls it.

CSS is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, in speech, etc.

Status of this document

The following features are at-risk, and may be dropped during the CR period:

“At-risk” is a W3C Process term-of-art, and does not necessarily imply that the feature is in danger of being dropped or delayed. It means that the WG believes the feature may have difficulty being interoperably implemented in a timely manner, and marking it as such allows the WG to drop the feature if necessary when transitioning to the Proposed Rec stage, without having to publish a new Candidate Rec without the feature first.

1. Introduction

This section is normative.

CSS takes a source document, organized as a tree of elements, and renders it onto a canvas (such as your screen, a piece of paper, or an audio stream). To do this, it generates an intermediary structure, the box tree, which represents the formatting structure of the rendered document. Each box represents its corresponding element (or pseudo-element) in space and/or time on the canvas.

To create the box tree, CSS first uses cascading and inheritance, to assign a computed value for each CSS property to each element in the source tree. (See [CSS3-CASCADE].)

Then, for each element, it generates zero or more boxes as specified by that element’s display property. Typically, an element generates a single box. However, some display values (e.g. display: list-item) generate more than one box (e.g. a principal block box and a marker box). And some values (such as none or contents) cause the element and/or its descendants to not generate any boxes at all. Boxes are assigned the same styles as their generating element, unless otherwise indicated. They’re often referred to by their display type—e.g. a box generated by an element with display: block is called a “block box” or just a “block”.

An anonymous box is is a box that is not associated with any element. Anonymous boxes are generated in certain circumstances to fix up the box tree when it requires a particular nested structure that is not provided by the boxes generated from the element tree. For example, a table cell box requires a particular type of parent box (the table row box), and will generate an anonymous table row box around itself if its parent is not a table row box. (See [CSS2] § 17.2.1.) Unlike element-generated boxes, whose styles inherit strictly through the element tree, anonymous boxes (which only exist in the box tree) inherit through their box tree parentage.

In the course of layout, a box may be broken into multiple fragments. This happens, for example, when an inline box is broken across lines, or when a block box is broken across pages or columns. A box therefore consists of one or more box fragments. See [CSS3-BREAK] for more information on fragmentation.

Note: Many of the CSS specs were written before this terminology was ironed out, or refer to things incorrectly, so view older specs with caution when they’re using these terms. It should be possible to infer from context which term they really mean. Please report errors in specs when you find them, so they can be corrected.

Note: Further information on the “aural” box tree and its interaction with the display property can be found in the CSS Speech Module. [CSS3-SPEECH]

1.1. Module interactions

This module replaces and extends the definition of the display property defined in [CSS2] section 9.2.4.

None of the properties in this module apply to the ::first-line or ::first-letter pseudo-elements.

1.2. Values

This specification follows the CSS property definition conventions from [CSS2].

In addition to the property-specific values listed in their definitions, all properties defined in this specification also accept the CSS-wide keywords as their property value. For readability it has not been repeated explicitly.

2. Box Layout Modes: the display property

Name: display
Value: <display-normal> | <display-listitem> | <display-internal> | <display-box> | <display-legacy>
Initial: inline
Applies to: all elements
Inherited: no
Percentages: n/a
Media: all
Computed value: see prose
Canonical order: per grammar
Animatable: no

The display property defines box’s display type, which consists of the two basic qualities of how an element generates boxes:

Some display values have additional side-effects, such as:

Values are defined as follows:

<display-outside>  = block-level | inline-level | run-in ;
<display-inside>   = auto | block | table | flex | grid | ruby ;
<display-normal>   = <display-outside> || <display-inside> || flow-root ;
<display-listitem> = list-item && <display-outside>? && [ auto | block ]? && flow-root? ;
<display-internal> = table-row-group | table-header-group |
                     table-footer-group | table-row | table-cell |
                     table-column-group | table-column | table-caption |
                     ruby-base | ruby-text | ruby-base-container |
                     ruby-text-container ;
<display-box>      = contents | none ;
<display-legacy>   = inline | inline-block | inline-list-item |
                     inline-table | inline-flex | inline-grid ;

The computed value is obtained from the following algorithm, after the display types have been modified by a possible blockification or inlinification, and after converting an auto inner display type to block when the outer display type is block-level.

The following informative table summarizes the basic values of display:

Short display Full display Generated box
none subtree omitted from box tree
contents element replaced by contents in box tree
block block-level block block-level block container aka block box
flow-root block-level auto flow-root block-level block container that establishes a new block formatting context (BFC)
inline inline-level auto inline box
inline-block inline-level block inline-level block container
run-in run-in auto run-in box (inline box with special box-tree-munging rules)
list-item list-item block-level auto block box with additional marker box
inline-list-item list-item inline-level auto inline box with additional marker box
flex block-level flex block-level flex container
inline-flex inline-level flex inline-level flex container
grid block-level grid block-level grid container
inline-grid inline-level grid inline-level grid container
ruby inline-level ruby inline-level ruby container
block ruby block-level ruby block box containing ruby container
table block-level table block-level table wrapper box containing table box
inline-table inline-level table inline-level table wrapper box containing table box
<display-internal> types layout-specific internal box

Note: Following the precedence rules of “most backwards-compatible, then shortest”, serialization of equivalent display values uses the “Short display” column. [CSSOM]

2.1. Outer Display Roles for Flow Layout: the block-level, inline-level, and run-in keywords

The <display-outside> keywords specify the element’s outer display type, which is essentially its role in flow layout. They are defined as follows:

block-level
The element generates a block-level box when placed in flow layout. [CSS2]
inline-level
The element generates an inline-level box when placed in flow layout. [CSS2]
run-in
The element generates a run-in box when placed in flow layout. Run-in elements act like inlines or blocks, depending on the surrounding elements. See §3 Run-In Layout for details.

If a <display-outside> value is specified but <display-inside> is omitted, the element’s inner display type defaults to auto.

If the element has an inner display type that generates multiple boxes, such as table or ruby, the outer display type applies to the principal box.

2.2. Inner Display Layout Models: the auto, block, table, flex, grid, and ruby keywords

The <display-inside> keywords specify the element’s inner display type, which defines the type of formatting context that lays out its contents (assuming it is a non-replaced element). They are defined as follows:

auto
If (after inlinifying or blockifying, when applicable) the element’s outer display type is block-level, then auto is changed to block, and display computes accordingly.

Otherwise, the element generates an inline box.

block
The element generates a block container box, and lays out its contents using flow layout.

Depending on the outer display type, the value of other properties (such as position, float, or overflow) and whether it is itself participating in a block formatting context, the element either establishes a new block formatting context for its contents or integrates its contents into its parent formatting context. See CSS2.1 Chapter 9. [CSS2]

table
The element generates a principal table wrapper box that establishes a block formatting context, and which contains an additionally-generated block-level table box that establishes a table formatting context. [CSS2]
flex
The element generates a principal flex container box and establishes a flex formatting context. [CSS3-FLEXBOX]
grid
The element generates a principal grid container box, and establishes a grid formatting context. [CSS3-GRID-LAYOUT]
ruby
The element generates a principal auto container box, which contains an additionally-generated inline-level ruby container that establishes a ruby formatting context in addition to integrating its base-level contents into its parent formatting context. [CSS3RUBY]

If a <display-inside> value is specified but <display-outside> is omitted, the element’s outer display type defaults to block-levelexcept for ruby and auto, which default to inline-level.

2.3. Becoming a formatting context: the flow-root keyword

The flow-root keyword causes the element to become a formatting context. If the element’s inner display type is table, flex, grid, this condition is satisfied. Otherwise, if the element’s inner display type is auto, block or ruby, the principal box becomes a block container which establishes a BFC. This change does not affect the computed value of the display property.

If the flow-root keyword is specified and both <display-outside> and <display-inside> are omitted, the element’s outer display type defaults to block-level. If only one display type is ommitted, it defaults as usual.

In some circumstances, an element may become a formatting context by other means than the flow-root keyword (see [CSS-CONTAIN-1] or [CSS3-MULTICOL] for examples).

Note: the flow-root keyword usually has no effect on an inline-block, because it already establishes a BFC. But if that box is blockified, with flow-root the resulting block box will continue establishing a BFC. Without flow-root, it might integrate its contents into its parent BFC instead.

How should an element with a layout-internal inner display type behave when becoming a formatting context?

Should the flow-root keyword be allowed in <display-internal>? It might be useful in case the element is blockified.

2.4. Generating Marker Boxes: the list-item keyword

The list-item keyword causes the element to generate a ::marker pseudo-element box [CSS-PSEUDO-4] with the content specified by its list-style properties (CSS 2.1§12.5 Lists) [CSS2] together with a principal box of the specified type for its own contents.

If the list-item keyword is specified and both <display-outside> and <display-inside> are omitted, the element’s outer display type defaults to block-level. If only one display type is ommitted, it defaults as usual.

Note: In this level, as restricted in the grammar, a list-item can only be a block box, a block formatting context root box, an inline box, or an inline-block box. This restriction may be relaxed in a future level of this module.

2.5. Layout-Internal Display Types: the table-* and ruby-* keywords

Some layout models, such as table and ruby, have a complex internal structure, with several different roles that their children and descendants can fill. This section defines those “layout-internaldisplay values, which only have meaning within that particular layout mode.

Unless otherwise specified, both the inner display type and the outer display type of elements using these display values are set to the given keyword.

The <display-internal> keywords are defined as follows:

table-row-group, table-header-group, table-footer-group, table-row, table-cell, table-column-group, table-column
The element is an internal table element. It generates the appropriate internal table box which participates in a table formatting context. See CSS2§17.2 [CSS2].

table-cell boxes have a block inner display type.

table-caption
The element generates a table caption box, which is a block box with special behavior with respect to table and table wrapper boxes. See CSS2§17.2 [CSS2].

table-caption boxes have a block inner display type.

ruby-base, ruby-text, ruby-base-container, ruby-text-container
The element is an internal ruby element. It generates the appropriate internal ruby box which participates in a ruby formatting context. [CSS3RUBY]

ruby-base and ruby-text have an auto inner display type.

Boxes with layout-specific display types generate anonymous wrapper boxes around themselves when placed in an incompatible parent, as defined by their respective specifications.

For example, Table Layout requires that a table-cell box must have a table-row parent box.

If it is misparented, like so:

<div style="display:block;">
  <div style="display:table-cell">...</div>
</div>

It will generate wrapper boxes around itself, producing a structure like:

block box
└anonymous table box
 └anonymous table-row-group box
  └anonymous table-row box
   └table-cell box

Even if the parent is another internal table element, if it’s not the correct one, wrapper boxes will be generated. For example, in the following markup:

<div style="display:table;">
  <div style="display:table-row">
    <div style="display:table-cell">...</div>
  </div>
</div>

Anonymous wrapper box generation will produce:

table box
└anonymous table-row-group box
 └table-row box
  └table-cell box

This "fix-up" ensures that table layout has a predictable structure to operate on.

2.6. Box Generation: the none and contents keywords

While display can control the types of boxes an element will generate, it can also control whether an element will generate any boxes at all.

The <display-box> keywords are defined as follows:

contents
The element itself does not generate any boxes, but its children and pseudo-elements still generate boxes as normal. For the purposes of box generation and layout, the element must be treated as if it had been replaced in the element tree by its contents (including both its source-document children and its pseudo-elements, such as ::before and ::after pseudo-elements, which are generated before/after the element’s children as normal).

Note: As only the box tree is affected, any semantics based on the document tree, such as selector-matching and event handling, are not affected.

This value behaves as display: none on replaced elements and other elements whose rendering is not entirely controlled by CSS; see Appendix B: Effects of display: contents on Unusual Elements for details.

Note: Replaced elements and form controls are treated specially because removing only the element’s own generating box is a more-or-less undefined operation. As this behavior may be refined if use cases (and more precise rendering models) develop, authors should use display: none rather than display: contents on such elements for forward-compatibility.

none
The element and its descendants generate no boxes.

Elements with either of these values do not have inner or outer display types, because they don’t generate any boxes at all.

Note: As these values cause affected elements to not generate a box, anonymous box generation rules will ignore the elided elements entirely, as if they did not exist in the box tree.

Markup-based relationships, however, are not affected by these values, as they are solely rendering-time effects. For example, although they may affect which table cell appears in a column, they do not affect which table cell is associated with a particular column element. Similarly, they cannot affect which HTML summary element is associated with a particular table or whether a legend is the name of a fieldset.

2.7. Precomposed Inline-level Display Values

CSS level 2 used a single-keyword syntax for display, requiring separate keywords for block-level and inline-level variants of the same layout mode. These <display-legacy> keywords map as follows:

inline
Behaves as inline-level.
inline-block
Behaves as inline-level block.
inline-table
Behaves as inline-level table.
inline-flex
Behaves as inline-level flex.
inline-grid
Behaves as inline-level grid.
inline-list-item
Behaves as inline-level list-item.

2.8. Automatic Box Type Transformations

Some layout effects require blockification or inlinification of the box type, which sets the box’s outer display type to block-level or inline-level (respectively). (This has no effects on display types that generate no box at all, such as none or contents.)

Some examples of this include:

If an inline-level auto box is inlinified, it recursively inlinifies all of its in-flow children, so that no block-level descendants break up the inline formatting context in which it participates.

If a layout-internal box is blockified, its inner display type converts to auto so that it becomes a block container.

Should conversion of layout-internal display types also happen for inlinification? If it does, should it change to auto or block? If it doesn’t, then anonymous-box fixup will handle things.

The root element’s display type is always blockified. Additionally, a display of contents computes to block on the root element.

3. Run-In Layout

A run-in box is a box that merges into a block that comes after it, inserting itself at the beginning of that block’s inline-level content. This is useful for formatting compact headlines, definitions, and other similar things, where the appropriate DOM structure is to have a headline preceding the following prose, but the desired display is an inline headline laying out with the text.

For example, dictionary definitions are often formatted so that the word is inline with the definition:
<dl class='dict'>
  <dt>dictionary
  <dd>a book that lists the words of a language in alphabetical
      order and gives their meaning, or that gives the equivalent
      words in a different language.
  <dt>glossary
  <dd>an alphabetical list of terms or words found in or relating
      to a specific subject, text, or dialect, with explanations; a
      brief dictionary.
</dl>
<style>
.dict > dt {
  display: run-in;
}
.dict > dt::after {
  content: ": "
}
</style>

Which is formatted as:

dictionary: a book that lists the words of a language
in alphabetical order and explains their meaning.

glossary: an alphabetical list of terms or words found
in or relating to a specific subject, text, or dialect,
with explanations; a brief dictionary.

A run-in box behaves exactly as an inline-level box, except:

A run-in sequence is a maximal sequence of consecutive sibling run-in boxes and intervening white space and/or out-of-flow boxes.

Note: This statement implies that out-of-flow boxes are reparented if they are between two run-in boxes. Another alternative would be to leave behind the intervening out-of-flow boxes, or to have out-of-flow boxes impede the running-in of earlier boxes. Implementers and authors are encouraged to contact the CSSWG if they have a preferred behavior, as this one was picked somewhat at random.

Note: As the earliest run-in represents the first text on the first formatted line of its containing block, a ::first-letter pseudo-element applied to that block element selects the first letter of the run-in, rather than the first letter of its own contents.

Note: This run-in model is slightly different from the one proposed in earlier revisions of [CSS2].

Appendix A: Glossary

The following terms are defined here for convenience:

principal box
When an element generates one or more boxes, one of them is the principal box, which contains its descendant boxes and generated content, and is also the box involved in any positioning scheme.

Some elements may generate additional boxes in addition to the principal box (such as list-item elements, which generate an additional marker box, or table elements, which generate a principal table wrapper box and an additional table box. These additional boxes are placed with respect to the principal box.

inline-level
Content that participates in inline layout. Specifically, inline-level boxes and text.
block-level
Content that participates in block layout. Specifically, block-level boxes.
inline box
A non-replaced inline-level box whose inner display type is auto. The contents of an inline box participate in the same inline formatting context as the inline box itself.
inline
Used as a shorthand for inline box or inline-level box where unambiguous, or as an adjective meaning inline-level. The latter usage is deprecated.
atomic inline
An inline-level box that is replaced (such as an image) or that establishes a new formatting context (such as an inline-block or inline-table) and cannot split across lines (as inline boxes and ruby containers can).

Any inline-level box whose inner display type is not auto establishes a new formatting context of the specified inner display type.

block container
A block container either contains only inline-level boxes participating in an inline formatting context, or contains only block-level boxes participating in a block formatting context (possibly generating anonymous block boxes to ensure this constraint, as defined in CSS2§9.2.1.1).

A block container that contains only inline-level content establishes a new inline formatting context. The element then also generates a root inline box which wraps all of its inline content. Note, this root inline box concept effectively replaces the "anonymous inline element" concept introduced in CSS2§9.2.2.1.

A block container that contains only block-level boxes establishes a new block formatting context if its parent formatting context is not a block formatting context; otherwise, when participating in a block formatting context itself, it either establishes a new block formatting context for its contents or continues the one in which it participates, as determined by the constraints of other properties (such as overflow or align-content).

Note: Not all block container boxes are block-level boxes: non-replaced inline blocks and non-replaced table cells are block containers but not block-level boxes. Block-level boxes that are also block containers are called block boxes.

block box
A block-level box that is also a block container.
block
Used as a shorthand for block box, block-level box, or block container box, where unambiguous.
replaced element
An element whose content is outside the scope of the CSS formatting model, such as an image, embedded document, or applet. For example, the content of the HTML img element is often replaced by the image that its src attribute designates. Replaced elements often have intrinsic dimensions: an intrinsic width, an intrinsic height, and an intrinsic ratio. For example, a bitmap image has an intrinsic width and an intrinsic height specified in absolute units (from which the intrinsic ratio can obviously be determined). On the other hand, other documents may not have any intrinsic dimensions (for example, a blank HTML document).

User agents may consider a replaced element to not have any intrinsic dimensions if it is believed that those dimensions could leak sensitive information to a third party. For example, if an HTML document changed intrinsic size depending on the user’s bank balance, then the UA might want to act as if that resource had no intrinsic dimensions.

The content of replaced elements is not considered in the CSS rendering model.

containing block
A rectangle that forms the basis of sizing and positioning for the boxes associated with it (usually the children of the box that generated it). Notably, a containing block is not a box (it is a rectangle), however it is often derived from the dimensions of a box. If properties of a containing block are referenced, they reference the values on the box that generated the containing block. (For the initial containing block, the values are taken from the root element.) See [CSS2] Section 9.1.2 and Section 10.1 for details.
containing block chain
A sequence of successive containing blocks that form an ancestor-descendant chain through the containing block relation. For example, an inline box’s containing block is the content box of its closest block container ancestor; if that block container is an in-flow block, then its containing block is formed by its parent block container; if that grandparent block container is absolutely positioned, then its containing block is the padding edges of its closest positioned ancestor (not necessarily its parent), and so on up to the initial containing block.
initial containing block
The containing block of the root element. See CSS2.1§10.1 for continuous media; and [CSS3PAGE] for paged media.
formatting context
A formatting context is the environment into which a set of related boxes are laid out. Different formatting contexts lay out their boxes according to different rules. For example, a flex formatting context lays out boxes according to the flex layout rules [CSS3-FLEXBOX], whereas a block formatting context lays out boxes according to the block-and-inline layout rules [CSS2].

When a box establishes a new formatting context (whether that formatting context is of the same type as its parent or not), it essentially creates a new, independent layout environment: except through the sizing of the box itself, the layout of its descendants is (generally) not affected by the the rules and contents of the formatting context outside the box, and vice versa.

For example, in a block formatting context, floated boxes affect the layout of surrounding boxes. But their effects do not escape their formatting context: the box establishing their formatting context grows to fully contain them, and floats from outside that box are not allowed to protrude into and affect the contents inside the box.

As another example, margins do not collapse across formatting context boundaries.

Exclusions are able to affect content across formatting context boundaries. (At time of writing, they are the only layout feature that can.) [CSS3-EXCLUSIONS]

block formatting context
inline formatting context
Block and inline formatting contexts are defined in CSS 2.1 Section 9.4.
BFC
Informal abbreviation for block formatting context. Often used to refer to a block formatting context root, that is, a block box that establishes a new block formatting context for its contents.
out-of-flow
in-flow
A box is out-of-flow if it is floated (via float) or absolutely-positioned (via absolute or fixed positioning). A box is in-flow if it is not out-of-flow.

Note: some formatting contexts inhibit floating, so that an element with float: left is not necessarily out-of-flow.

See [CSS2] Chapter 9 for a fuller definition of these terms.

Appendix B: Effects of display: contents on Unusual Elements

This section is (currently) non-normative.

Some elements aren’t rendered purely by CSS box concepts; for example, replaced elements (such as img), many form controls (such as input), and SVG elements.

This appendix defines how they interact with display: contents.

HTML Elements

br
wbr
meter
progress
applet
canvas
embed
object
audio
iframe
img
video
frame
frameset
input
textarea
select

display: contents behaves as display: none.

legend

Per HTML, a legend with display: contents is not a rendered legend, so it does not have magical display behavior. (Thus, it reacts to display: contents normally.)

button
details
fieldset

These elements don’t have any special behavior; display: contents simply removes their principal box, and their contents render as normal.

any other HTML element

Behaves as normal for display: contents.

SVG Elements

Root svg

display: contents behaves as display: none.

Nested svg
g
use (treated as a Shadow DOM container)
tspan

display: contents strips the element from the formatting tree, and hoists its contents up to display in its place.

any other SVG elements

display: contents behaves as display: none.

Acknowledgments

We would like to thank the many people who have attempted to separate out the disparate details of box generation over the years, most particularly Bert Bos, whose last attempt with display-model and display-role didn’t get anywhere, but primed us for the current spec, and Anton Prowse, whose relentless assault on CSS2.1 Chapter 9 forced some order out of the chaos.

Changes

Changes since the ??? Working Draft include:

Changes since the 21 July 2015 Working Draft include:

Changes since the 11 September 2014 Working Draft include:

4. Privacy and Security Considerations

This specification introduces no new privacy or security considerations.

Conformance

Document conventions

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

Examples in this specification are introduced with the words “for example” or are set apart from the normative text with class="example", like this:

This is an example of an informative example.

Informative notes begin with the word “Note” and are set apart from the normative text with class="note", like this:

Note, this is an informative note.

Advisements are normative sections styled to evoke special attention and are set apart from other normative text with <strong class="advisement">, like this: UAs MUST provide an accessible alternative.

Conformance classes

Conformance to this specification is defined for three conformance classes:

style sheet
A CSS style sheet.
renderer
A UA that interprets the semantics of a style sheet and renders documents that use them.
authoring tool
A UA that writes a style sheet.

A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module.

A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.)

An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module.

Requirements for Responsible Implementation of CSS

The following sections define several conformance requirements for implementing CSS responsibly, in a way that promotes interoperability in the present and future.

Partial Implementations

So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers must treat as invalid (and ignore as appropriate) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents must not selectively ignore unsupported property values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.

Implementations of Unstable and Proprietary Features

To avoid clashes with future stable CSS features, the CSSWG recommends following best practices for the implementation of unstable features and proprietary extensions to CSS.

Implementations of CR-level Features

Once a specification reaches the Candidate Recommendation stage, implementers should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec, and should avoid exposing a prefixed variant of that feature.

To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group.

Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at http://www.w3.org/Style/CSS/Test/. Questions should be directed to the public-css-testsuite@w3.org mailing list.

Index

Terms defined by this specification

Terms defined by reference

References

Normative References

[CSS-ALIGN-3]
Elika Etemad; Tab Atkins Jr.. CSS Box Alignment Module Level 3. URL: https://www.w3.org/TR/css-align-3/
[CSS-CASCADE-4]
Elika Etemad; Tab Atkins Jr.. CSS Cascading and Inheritance Level 4. URL: https://www.w3.org/TR/css-cascade-4/
[CSS-INLINE-3]
Dave Cramer; Elika Etemad; Steve Zilles. CSS Inline Layout Module Level 3. URL: https://www.w3.org/TR/css-inline-3/
[CSS-LISTS-3]
Tab Atkins Jr.. CSS Lists and Counters Module Level 3. URL: https://www.w3.org/TR/css-lists-3/
[CSS-POSITION-3]
Rossen Atanassov; Arron Eicholz. CSS Positioned Layout Module Level 3. URL: https://www.w3.org/TR/css-position-3/
[CSS-PSEUDO-4]
Daniel Glazman; Elika Etemad; Alan Stearns. CSS Pseudo-Elements Module Level 4. URL: https://www.w3.org/TR/css-pseudo-4/
[CSS-VALUES-3]
Tab Atkins Jr.; Elika Etemad. CSS Values and Units Module Level 3. URL: https://www.w3.org/TR/css-values-3/
[CSS2]
Bert Bos; et al. Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification. 7 June 2011. REC. URL: https://www.w3.org/TR/CSS2
[CSS22]
Bert Bos. Cascading Style Sheets Level 2 Revision 2 (CSS 2.2) Specification. URL: https://www.w3.org/TR/CSS22/
[CSS3-BREAK]
Rossen Atanassov; Elika Etemad. CSS Fragmentation Module Level 3. URL: https://www.w3.org/TR/css-break-3/
[CSS3-CASCADE]
Elika Etemad; Tab Atkins Jr.. CSS Cascading and Inheritance Level 3. URL: https://www.w3.org/TR/css-cascade-3/
[CSS3-FLEXBOX]
Tab Atkins Jr.; Elika Etemad; Rossen Atanassov. CSS Flexible Box Layout Module Level 1. URL: https://www.w3.org/TR/css-flexbox-1/
[CSS3-GRID-LAYOUT]
Tab Atkins Jr.; Elika Etemad; Rossen Atanassov. CSS Grid Layout Module Level 1. URL: https://www.w3.org/TR/css-grid-1/
[CSS3-SPEECH]
Daniel Weck. CSS Speech Module. 20 March 2012. CR. URL: https://www.w3.org/TR/css3-speech/
[CSS3PAGE]
Melinda Grant; et al. CSS Paged Media Module Level 3. 14 March 2013. WD. URL: https://www.w3.org/TR/css3-page/
[CSS3RUBY]
Elika Etemad; Koji Ishii. CSS Ruby Layout Module Level 1. URL: https://www.w3.org/TR/css-ruby-1/
[HTML]
Anne van Kesteren; et al. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/
[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
[SELECTORS-4]
Selectors Level 4 URL: https://www.w3.org/TR/selectors4/
[SVG2]
Nikos Andronikos; et al. Scalable Vector Graphics (SVG) 2. URL: https://www.w3.org/TR/SVG2/

Informative References

[CSS-CONTAIN-1]
Florian Rivoal. CSS Containment Module Level 1. URL: https://www.w3.org/TR/css-contain-1/
[CSS3-EXCLUSIONS]
Rossen Atanassov; Vincent Hardy; Alan Stearns. CSS Exclusions Module Level 1. URL: https://www.w3.org/TR/css3-exclusions/
[CSS3-MULTICOL]
Håkon Wium Lie. CSS Multi-column Layout Module. 12 April 2011. CR. URL: https://www.w3.org/TR/css3-multicol
[CSSOM]
Simon Pieters; Glenn Adams. CSS Object Model (CSSOM). URL: https://www.w3.org/TR/cssom-1/

Property Index

Name Value Initial Applies to Inh. %ages Media Ani­mat­able Canonical order Com­puted value
display <display-normal> | <display-listitem> | <display-internal> | <display-box> | <display-legacy> inline all elements no n/a all no per grammar see prose

Issues Index

How should an element with a layout-internal inner display type behave when becoming a formatting context?
Should the flow-root keyword be allowed in <display-internal>? It might be useful in case the element is blockified.
Should conversion of layout-internal display types also happen for inlinification? If it does, should it change to auto or block? If it doesn’t, then anonymous-box fixup will handle things.