Name
display — NN 4 IE 4 CSS 1
Synopsis
Inherited: No
A multipurpose attribute that determines whether the element should
be rendered in the document (and space reserved for it in the
content). If the element is to be rendered, the attribute sets what
type of element (block or inline) it is. The list of available values
recognized by Navigator 4 and Internet Explorer 4 (and CSS1) is
fairly short: block
| inline
|
list-item
| none
, yet both
browsers do not actually change the element type with values other
than none
. CSS2 expands the list significantly.
When set to none
, the element is hidden from view,
and all surrounding content cinches up to occupy whatever space the
element would normally occupy. This is different from the
visibility
attribute, which reserves space for the
element while hiding it from view.
CSS Syntax
display: displayType
JavaScript Equivalent
display
Value
One of the constant values: block
|
compact
| inline
|
inline-table
| list-item
|
none
| run-in
|
table
| table-caption
|
table-cell
| table-column-group
| table-footer-group
|
table-header-group
| table-row
| table-row-group
.
Initial Value
inline
Example
hidden {display: none}
Applies To
All elements.
Object Model Reference
- IE
[window.]document.all.
elementID
.style.display
Get Dynamic HTML: The Definitive Reference 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.