pre

FilterElements

<pre> ... </pre>

Delimits "preformatted" text, meaning that lines are displayed exactly as they are typed in, honoring whitespace such as multiple character spaces and line breaks. By default, text within a pre element is displayed in a monospace font such as Courier. The example below would be rendered about the same in the browser as it appears in this book.

Start/End Tags

Required/Required

Specifications

  • HTML 4.01
  • HTML5

width=

Values: number
Deprecated. Not in HTML5. This optional attribute determines how many characters to fit on a single line within the pre block.

xml:space=

Values: preserve
XHTML only. Instructs XML processors to preserve the whitespace in the element.
<pre>
This is         an
             example of

text with a  lot of
                curious
                   whitespace.
</pre>

Rendered Example



This is         an
             example of

text with a  lot of
                curious
                   whitespace.