display
Changes how an element is displayed. Note that the default value varies depending on the HTML element.
Sample Code
div.test { display: inline;}
div.test1 { display: block;}
div.test2 { display: none;}
Available Values
| Value | Description |
|---|---|
| none | Hides the element. Layout is calculated as if the element does not exist. |
| inline | Treats the element as an inline-level element. |
| inline-block | Treats the element as an inline-block element (replaced element). |
| block | Treats the element as a block-level element. |
| list-item | Treats the element as a list item. A list marker is also generated. Behaves like a li element. |
| table | Behaves like a table element. ※ Not supported in IE8 and earlier. |
| table-caption | Behaves like a caption element. ※ Not supported in IE8 and earlier. |
| table-cell | Behaves like a td element. ※ Not supported in IE8 and earlier. |
| table-row | Behaves like a tr element. ※ Not supported in IE8 and earlier. |
| table-column | Behaves like a col element. ※ Not supported in IE8 and earlier. |
| table-column-group | Behaves like a colgroup element. ※ Not supported in IE8 and earlier. |
| table-footer-group | Behaves like a tfoot element. ※ Not supported in IE8 and earlier. |
| table-header-group | Behaves like a thead element. ※ Not supported in IE8 and earlier. |
| table-row-group | Behaves like a tbody element. ※ Not supported in IE8 and earlier. |
Browser Compatibility
Desktop
Supported in all versions
8 ○
7 ○
6 ○
6 or earlier ×Mobile
Android Browser
4.4+ ○
3 or earlier ×Same support as desktop version
Same support as desktop version
※ Version data based on MDN .
Overview
Changes how an element is displayed. Note that the default value varies depending on the HTML element.
The display property is also covered in this article, which is aimed at beginners.
If you find any errors or copyright issues, please contact us.