The display property
The display
property - sets the way
an element is displayed by the browser.
Syntax
selector {
display: value;
}
Values
Value | Description |
---|---|
block |
Block element. |
inline |
Inline element. |
inline-block |
Inline-block element. |
list-item |
An element will become a list item and a list marker will appear in front of it. |
flex |
Sets an element to be a block element, and its children will become flex elements. |
inline-flex |
Sets an element to be an inline-block element, and its children will become flex elements. |
grid |
Creates a grid element. |
none |
An element will disappear altogether and all other elements will behave as if this element does not exist. |
table |
An element will behave like a table. |
table-cell |
An element will behave like a table cell. |
inline-table |
An element will behave like a table, whereas a table is an inline element and other elements, such as text, will wrap around it. |
table-caption |
An element will behave like the caption tag. |
table-column |
An element will behave like a table column. |
table-row |
An element will behave like a table row. |
table-column-group |
An element will behave like the colgroup tag. |
table-footer-group |
An element will behave like the tfoot tag. |
table-header-group |
An element will behave like the thead tag. |
table-row-group |
An element will behave like the tbody tag. |
run-in |
Sets an element to be block or inline depending on context. |
By default, elements can have different display
values.