17. The Visual Formatting Model

17. The Visual Formatting Model

How an element is displayed normally depends on the element, but can be changed with the display property.
block
Generate a block box. (Default for <div>, <p>, <pre> etc.)
inline
Generate an inline box. (Default for <span>, <em>, <b>, etc.)
list-item
Display the element as a list item. (Default for <li>.)
table, table-row, table-cell, etc.
Display the element like a part of a table. Not in IE.
inline-block
Generate a block box that is flowed like an inline box.
  • In IE, this works only on elements that have a default display of inline.
  • In mozilla-based browsers, this does not work at all. The value -moz-inline-box will have a similar effect, except that it does not wrap its contents.
none
The document is displayed as if this element (and its descendants) did not exist.
Ken Keys, CAIDA, 2006-12-01