Definition and Usage
The display property specifies the type of box the element should generate.
illustrate
This property is used to define the type of display box that the element generates when building the layout. For document types such as HTML, careless use of display can be dangerous because it may violate the display hierarchy already defined in HTML. With XML, since XML doesn't have this kind of hierarchy built in, all display is absolutely necessary.
Note: The values compact and marker were present in CSS2, but have been removed from CSS2.1 due to lack of broad support.
Defaults: | inline |
---|---|
Inheritance: | no |
Version: | CSS1 |
JavaScript syntax: | object.style.display="inline" |
possible values
value | describe |
---|---|
none | This element will not be displayed. |
block | This element will appear as a block-level element with line breaks before and after this element. |
inline | default. This element is displayed as an inline element, without line breaks before and after the element. |
inline-block | Inline block element. (value added in CSS2.1) |
list-item | This element is displayed as a list. |
run-in | This element is displayed as a block-level element or an inline element depending on the context. |
compact | There is value compact in CSS, but has been removed from CSS2.1 due to lack of widespread support. |
marker | There were value markers in CSS, but have been removed from CSS2.1 due to lack of widespread support. |
table | This element is displayed as a block-level table (similar to <table>) with line breaks before and after the table. |
inline-table | This element is displayed as an inline table (similar to <table> ) without line breaks before and after the table. |
table-row-group | This element is displayed as a grouping of one or more lines (similar to <tbody>). |
table-header-group | This element is displayed as a grouping of one or more lines (similar to <thead>). |
table-footer-group | This element is displayed as a grouping of one or more rows (similar to <tfoot>). |
table-row | This element is displayed as a table row (similar to <tr>). |
table-column-group | This element is displayed as a grouping of one or more columns (similar to <colgroup>). |
table-column | This element will be displayed as a column of cells (similar to <col>) |
table-cell | This element will be displayed as a table cell (similar to <td> and <th>) |
table-caption | This element will be displayed as a table title (similar to <caption>) |
inherit | Specifies that the value of the display property should be inherited from the parent element. |