Name

pre — <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.

Attributes

Core,Internationalization, Events

width="number"

Deprecated. This optional attribute determines how many characters to fit on a single line within the pre block.

xml:space="preserve"

XHTML only. Instructs XML processors to preserve the whitespace in the element.

Example

<pre>
This is               an             example of

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

Get HTML and XHTML Pocket Reference, 3rd Edition 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.