CSS display property
Browser support · legacy reference
ChromeSince v4
SafariSince v3
FirefoxSince v3.1
Internet ExplorerSince v8
EdgeSince v8
OperaSince v7
Description
CSS display property changes the behavior of element.
Syntax
display : block | inline | table | flex | grid | table-row-group | table-header-group | table-footer-group | table-row | table-cell | table-column-group | table-column | table-caption | none | inline-block | inline-table | inline-flex | inline-grid
Property values
flex
-
The element represents a flex container and constitutes all the flex properties.
- Try it
display: flex; table-row-group
-
In this case, the content that overflows vertically out of the box becomes invisible.
- Try it
display: table-row-group; table-header-group
-
In this case, the content that overflows vertically out of the box becomes invisible.
- Try it
display: table-header-group; table-footer-group
-
In this case, the content that overflows vertically out of the box becomes invisible.
- Try it
display: table-footer-group; table-column-group
-
The element represents a table-column-group (<colgroup/> <colgroup/>).
- Try it
display: table-column-group; table-column
-
The element represents a table-column-group (<col/> <col/>).
- Try it
display: table-column; inline-block
-
It behaves as block-level element but floating on the same line (if space available).
- Try it
display: inline-block; inline-table
-
It behaves as table element but floating on the same line (if space available).
- Try it
display: inline-table; inline-flex
-
It behaves as flex container but floating on the same line (if space available).
- Try it
display: inline-flex; inline-grid
-
It behaves as grid container but floating on the same line (if space available).
- Try it
display: inline-grid;
Applicable to
It applies to multi-column container.