The CSS display property
Description of property definition and use
The display property specifies the type of box that an element should generate.
Default: | inline |
---|---|
Inherited: | no |
Version: | CSS1 |
JavaScript syntax: | object .style.display="inline" |
Browser support
The numbers in the table support the first browser version number of the property.
The number immediately before -webkit-, -ms- or -moz- is the first browser version number that supports the prefix property.
Attributes | |||||
---|---|---|---|---|---|
display | 4.0 |
8.0
Partial from 5.5 |
3.0 | 3.1 | 7.0 |
The property value
Value | Describe |
---|---|
none | This element is not displayed. |
block | This element appears as a block-level element with line breaks before and after this element. |
inline | Default. This element is displayed as an inline element with no line breaks before and after the element. |
inline-block | The block element in the row. (New value for CSS2.1) |
list-item | This element is displayed as a list. |
run-in | This element is displayed as a block-level element or inline element based on the context. |
compact | The value compact is in CSS, but has been removed from CSS2.1 due to lack of broad support. |
marker | There is a value marker in CSS, but it has been removed from CSS2.1 due to lack of broad support. |
table | This element is displayed as a block-level table (similar to the one with line breaks before and after the table). |
inline-table | This element is displayed as an inline table (similar to the .lt;table,) with no line breaks before and after the table. |
table-row-group | This element is displayed as a grouping of one or more rows (similar to slt;tbody.gt;). |
table-header-group | This element is displayed as a grouping of one or more rows (similar to the .lt;thead>). |
table-footer-group | This element is displayed as a grouping of one or more rows (similar to slt;tfoot. |
table-row | This element is displayed as a table row (similar to slt;tr?gt;). |
table-column-group | This element is displayed as a grouping of one or more columns (similar to the .lt;colgroup.gt;). |
table-column | This element is displayed as a column of cells (similar to the |
table-cell | This element is displayed as a table cell (similar to slt;td;and slt;th-gt;) |
table-caption | This element is displayed as a table title (similar to the |
inherit | Specifies that the value of the display property should be inherited from the parent element. |
Related articles
CSS tutorials: CSS Display andvisibility
More instances
Use inheritance values
This example shows how to use the value of an inherited property.