CSS2 » Properties » display

Version: Level 1/Expanded in Level 2

Compability: IE4+  N4+
Most of the Level 2 additions are currently not supported by any browser.

Syntax:
display : block | compact | inline |inline-table | list-item| marker | none |run-in | table | table-caption | table-cell |table-column |table-column-group | table-footer-group | table-header-group | table-row| table-row-group
table-row-group
The table-row-group value displays the element as if it were a group of table rows.(Level 2)
table-row
The table-row value displays the element as if it were a table row.(Level 2)
table-header-group
The table-header-group value displays the element as if it were a group of table headers.(Level 2)
table-footer-group
The table-footer-group value displays the element as if it were a group of table footers.(Level 2)
table-column-group
The table-column-group value displays the element as if it were a group of table columns.(Level 2)
table-column
The table-column value displays the element as if it were a table column.(Level 2)
table-cell
The table-cell value displays the element as if it were a table cell.(Level 2)
table-caption
The table-caption value displays the element as if it were a table caption.(Level 2)
table
The table value displays the element as if it were a block-level table.(Level 2)
run-in
The run-in value assigns the element to be block-level or inline based upon the context.(Level 2)
none
The none value prevents the display of the element.(Level 1)
marker
The marker value assigns the content, before or after a box element, to be a marker. It is used with the :after and :before pseudo-elements.(Level 2)
list-item
The list-item value treats the element to be displayed as a list. Each item in the list can be preceded by an optional marker, such as the solid black circle, associated with the HTML tag.< li >(Level 1)
inline-table
The inline-table value displays a table as an inline element, or inline box, that does not have a line break before or after the table.(Level 2)
inline
The inline value treats the element to be displayed as an inline element, or inline box, that does not have a line break before or after the element. In other words, everything is displayed on the same line. (Level 1)
compact
The compact value assigns the element to be block-level or inline based upon the context.(Level 2)
block
The block value is the default. It treats the element to be displayed as a block-level element, or block-level box, that has a line break before and after the element.(Level 1)

The display property controls if or how an element will be displayed. This property is not inherited.

Code:
p { display: block; }
img { display: inline; }
li { display: list-item; }
img { display: none; }
Language(s):

The display property controls if or how an element will be displayed. This property is not inherited.

Examples

Code:
p { display: block; }
img { display: inline; }
li { display: list-item; }
img { display: none; }
Output:
Devguru logo Devguru logo Devguru logo
Explanation:

In this example, the second image is not displayed.

Language(s): CSS2