HomeReferencesHTML Tags

HTML Tag: pre

Preformatted text. Text where the whitespace (that is normally discarded by other elements) is as much a part of the content as the rest of the text. Commonly used to display computer code because it maintains nesting indentations.

HTML Dog, The Book HTML Dog book cover

HTML Dog is hosted by Titan Internet

Required Attributes

  • None.

Optional Attributes

Example


<p>The basic structure of an HTML document:</p>
<pre>
<code>&lt;html&gt;</code>
	<code>&lt;head&gt;</code>
	<code>&lt;/head&gt;</code>
	<code>&lt;body&gt;</code>
		<code>[stuff]</code>
	<code>&lt;/body&gt;</code>
<code>&lt;/html&gt; </code>
</pre>