Preformatted text is text that contains line breaks and spaces that are intended to be preserved at publication time.

Usage information

The <pre> element is often used for ASCII diagrams and code samples. It is the specialization base for the @codeblock element in the Technical Content edition.

Rendering expectations

Processors SHOULD preserve the line breaks and spaces that are present in the content of a <pre> element.

The contents of the <codeblock> element is typically rendered in a monospaced font.

Content model

(Text | <cite> | <include> | <keyword> | <ph> | <strong> | <em> | <b> | <i> | <line-through> | <overline> | <sup> | <sub> | <tt> | <u> | <q> | <term> | <text> | <tm> | <xref> | <state> | <data> | <sort-as> | <foreign> | <unknown> | <draft-comment> | <fn> | <indexterm> | <required-cleanup> )*


The following attributes are available on this element: display attributes, universal attributes, and @xml:space.


The following code sample shows preformatted text that contains white space and line breaks. When the following code sample is published, the white space and line breaks are preserved.

          MEMO: programming team fun day
Remember to bring a kite, softball glove, or other favorite
outdoor accessory to tomorrow's fun day outing at Zilker Park.
Volunteers needed for the dunking booth.