Property Description
The display property sets the type of box an element should generate.
This property has the following syntax:
display: value;
Property Values
Value | Description |
---|---|
block | The element will generate a block box (a line break before and after the element) |
flex | Displays an element as an block-level flex container |
inline | (default) The element will generate an inline box (no line break before or after the element) |
inline-block | The element will generate a block box, laid out as an inline box |
inline-flex | Displays an element as an inline-level flex container |
inline-table | The element will generate an inline box |
list-item | The element will generate a block box, and an inline box for the list marker |
none | The element will generate no box at all |
run-in | The element will generate a block or inline box, depending on context |
table | The element will behave like a table |
table-caption | The element will behave like a table caption |
table-cell | The element will behave like a table cell |
table-column | The element will behave like a table column |
table-column-group | The element will behave like a table column group |
table-footer-group | The element will behave like a table footer row group |
table-header-group | The element will behave like a table header row group |
table-row | The element will behave like a table row |
table-row-group | The element will behave like a table row group |
initial | Specifies that the value of the property should be set to the default value |
inherit | Specifies that the value of the property should be inherited from the parent element |
Examples
This example lets a paragraph generate an inline box.
p.inline {
display:inline;
}
Browser Support
Chrome | Firefox | IE | Safari | Opera |
---|---|---|---|---|
4.0 | 3.0 | 8.0 | 3.1 | 7.0 |
Miscellaneous Information
Inherited: | No |
---|---|
Defined In: | CSS1 |
Default Value: | inline |