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

What is pre-formatted text?

By Jennifer Kyrnin, About.com

Question: What is pre-formatted text?

Answer:

Pre-formatted text is a wonderful tool to force the text to look more like you want it to look. Well, not exactly, but the <pre></pre> tag creates text with the linebreaks and spacing that you put in. To do this, most browsers render the <pre></pre> tag with a mono-spaced font. This is a font that is the same width for every letter, even i and w.

Try the <pre> tag on your Web site with various different spacings and carriage returns. For example, try pasting the following into your Web page HTML (leave the spaces exactly as they are written):

<pre>
Twas  brillig  and  the   slithey  toves
  Did gyre and gimble
    in
      the
        wabe</pre>

The <pre> tag does more than just keep the spaces. In most browseres, it is also written in a monospace font. But you can change this with style sheets.

Learn more about the <pre></pre> tag.

More Web Design / HTML Q&A

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. What is pre-formatted text - The pre tag - Pre-formatted text

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

All rights reserved.