HTML and CSS Reference
Figure 2.13: using line breaks
he preformatted text element provides another means to control the
spacing of text content. It is sort of an anti-paragraph. Any text between the
starting and ending tags, <pre></pre> , is let essentially as is. Preformatted text
retains all line breaks and redundant blanks. Horizontal tabs are recognized
and expanded as if there were tab stops every eight characters across the page.
his is ideal for text copied from another source, such as an email message,
which needs to keep its line breaks and spacing intact. It can be pasted inside a
preformatted text element. he text is rendered in a monospace font by default,
although this can easily be changed with CSS.
Within the preformatted block no other block elements should be used.
Inline elements, including anchor and image elements, are appropriate. Exam-
ple 2.14 shows a simple example of preformatted text that creates the display
shown in Figure 2.14.
Example 2.14: preformatted text in HTML