1. Home
  2. Computing & Technology
  3. Web Design / HTML

<pre></pre>

By Jennifer Kyrnin, About.com

<pre> Description:

The <pre></pre> tag defines the enclosed text as pre-formatted.

<pre> Web Browser Support:

<pre> Attributes:

<pre> End Tag:

</pre> REQUIRED

<pre> Contents:

Text. The following tags are valid within the <pre> tag:
a, abbr, acronym, applet, b, basefont, bdo, big, br, button, cite, code, dfn, em, font, i, iframe, img, input, kbd, label, map, object, q, s, samp, script, select, small, span, strike, strong, sub, sup, textarea, tt, u, var

<pre> Valid Context:

The <pre> tag is valid within the following tags:
blockquote, body, button, center, dd, div, fieldset, form, iframe, li, noframes, noscript, object, td, th

<pre> Usage:

  • pre-formatted text
    <pre>
        x | o | x
       -----------
        o | o | x
       -----------
        o | x | x
    </pre>

<pre> Special Notes:

  • This tag usually displays the information in a monospaced font. But if you need your text to be monospaced, use the <tt> tag.
  • The width attribute is only there as advice for the browser, and many older browsers don't honor it.

More <pre> Information:

Return to XHTML Element (HTML Tags) Library

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. XHTML
  6. HTML Tags
  7. The pre Element - pre-formatted text - XHTML 1.0 HTML 4.0

©2008 About.com, a part of The New York Times Company.

All rights reserved.