Name

display — IE4 P/P | IE5 P/Y | NN4 P/P | Op3 P/-

Synopsis

Used to classify elements into broad categories. The most popular value is probably none, which suppresses the display of an element altogether. Gratuitous use of display with a document type such as HTML can be dangerous, since HTML already has a display hierarchy defined. However, in the case of XML, which has no such hierarchy, display is indispensable.

In CSS2, the range of values for display is dramatically expanded. See Chapter 10 for more details.

Example

.hide {display: none;}

Values

block | inline | list-item | none

Default

block

Inherited

no

Applies to

all elements

Get Cascading Style Sheets: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.