Language References
HTML 2, 3.2, 4, 4.01, 5
Renders text in a fixed-width font.
HTML Syntax
<pre
class = classname
id = value
style = css properties
title = text
event = script
>
The PRE element displays preformatted text in a fixed-width font. The element displays all white space and line breaks exactly as they appear, preserving its original layout.
PRE is commonly used to show code listings, tabulated information, and blocks of text that were created for some text-only form, such as electronic mail messages and news postings.
Unlike the XMP and PLAINTEXT elements, PRE does not suppress interpretation of other HTML tags. As such, special symbols must be used for any character that has a meaning in HTML that authors wish to be displayed, rather than interpreted. For example, the less than < and greater than > symbols to denote markup tags.
For more information on special symbols, see HTML Character Entity Reference.
This element is a block element. All PRE elements start on a new line, preceded by extra space.
PRE Members
<p>The basic structure of an HTML document is: </p>
<pre>
<html>
<head> Header info goes here </head>
<body> Body content goes here </body>
</html>
</pre>
which would render on a Web page as
The basic structure of an HTML document is:
<html>
<head> Header info goes here </head>
<body> Body content goes here </body>
</html>
CODE, KBD, SAMP, TT, XMP