This is a snapshot of an early working draft and has therefore been superseded by the HTML standard.

This document will not be further updated.

HTML 5

Call For Comments — 27 October 2007

3.10. Preformatted text

3.10.1. The pre element

Block-level element, and structured inline-level element.

Contexts in which this element may be used:
Where block-level elements are expected.
Where structured inline-level elements are allowed.
Content model:
Strictly inline-level content.
Element-specific attributes:
None.
DOM interface:
No difference from HTMLElement.

The pre element represents a block of preformatted text, in which structure is represented by typographic conventions rather than by elements.

Some examples of cases where the pre element could be used:

If, ignoring text nodes consisting only of whitespace, the only child of a pre is a code element, then the pre element represents a block of computer code.

If, ignoring text nodes consisting only of whitespace, the only child of a pre is a samp element, then the pre element represents a block of computer output.