Preformatted Text

Contact Us or call 1-877-932-8228
Preformatted Text

Preformatted Text

Occasionally it is desirable to output content as it is laid out in the code, whitespace and all. The <pre> tag is used for this purpose. It is often used in online coding tutorials (such as this one) so that the whitespace shown in the tutorial reflects how it would appear in the document it represents. The code below shows how <pre> is used:

Code Sample:

<meta charset="UTF-8">
<title>Preformatted Text</title>
<h1>Your First HTML Page</h1>
&lt;title&gt;Hello world!&lt;/title&gt;
	&lt;h1&gt;Hello world!&lt;/h1&gt;

The page is rendered as follows: