display attribute

Type:"block", "inline", "none"
Inherited:no
Used By:All block elements
Default:"block", except for SPAN, A, B, STRONG, EM, I, U, O, TT, ZAPF, SYMBOL, STRIKE, NOBR, BIG, SMALL, CODE, SUP or SUB, which are always "inline"

The display attribute controls how a block is positioned on the page. "block" elements are placed vertically one after the other on the page, from the top down. "inline" elements are intended for use in a paragraph of text - they are placed horizontally left to right (or right to left depending on Locale) on a line, wrapping to the next line when it's full.

In the current implementation, the only time you'd ever want to use this attribute would be inside a paragraph - when an element which is usually a "block" element is set to inline to cause it to appear inside the paragraph (which may be explicit or anonymous - see the userguide for more information).

The other option is that the value can be set to "none", which has the effect of causing the element and it's children to be ignored completely.

This causes the image to appear in the middle of the paragraph of text

<p>
This text is broken in
<img display="inline" src="file:/path/to/image.jpg"/>
two by an image
</p>

The second paragraph and it's children will not be added to the document

<p>First Paragraph</p>
<p display="none">Second Paragraph, which will <b>not</b> be shown</p>
<p>Third Paragraph</p>