asp.net.ph

Skip Navigation Links

PRE Element | PRE Object

Language References


HTML 2, 3.2, 4, 4.01, 5

Renders text in a fixed-width font.

HTML Syntax

Remarks

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.

Members

PRE Members

Example

<p>The basic structure of an HTML document is: </p>
<pre>
   &lt;html&gt;
      &lt;head&gt; Header info goes here &lt;/head&gt;
      &lt;body&gt; Body content goes here &lt;/body&gt;
   &lt;/html&gt;
</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>
See Also

CODE, KBD, SAMP, TT, XMP



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note