Main Index |
Top Of Tree |
Tag Index |
Tag History
- What is it?
- The PRE element indicates text that has been formatted for the
screen and is rendered using a fixed-width font. All characters are
interpreted literally and retained in display, including multiple spaces,
tabs, Carriage Returns and Linefeeds (all other cases of HTML collapse
multiple spaces, tabs, CRs, or linefeeds to a single space.)
- Attributes
- Width
- 2 | 3
| 3.2 | IE
| M | N
- Required? No
- Description:
This attribute specifies the maximum number of characters for a line
and allows the browser to select a suitable font and indentation.
Values of 40,
80 and 132
characters should be presented optimally, with other widths being
rounded up.
- Values: Positive integer values
Style Sheet Attributes
[More on Cascading Style Sheets]
- Class
- 2 | 3
| 3.2 | IE3B1
| M | N4B2
- Required? No
- Description:
This represents an assigned semantic classification grouping(s) for the
current tag.
- Values:
Given as a comma separated list of alphanumeric characters. Class names
may contain spaces (multiple consecutive spaces treated as a single
space.)
- ID
- 2 | 3
| 3.2 | IE3B1
| M | N4B2
- Required? No
- Description:
This assigns an alpha-numeric identifier that is unique
to this tag instance. Style sheets may use this attribute to reference
the current instance of this tag. Hyperlinks may also use this identifier
to serve as a destination.
- Values:
An alphanumeric string - initial character must be a letter followed
by alphabetic characters, digits, "-" or "."
characters. The allowable set of alpha-characters is restricted to the
A-Z and a-z set.
- Style
- 2 | 3
| 3.2 | IE3B1
| M | N4B3
- Required? No
- Description:
This attribute is a text string that provides rendering style
information for the current tag.
- Values:
Please see the description of
inline styles for more
information on how to use this attribute and its
possible values.
- Example
- <pre>
this
is a test
<pre>
- Parent Model
- %Block Format
Parent% |
%Multimedia
Parent% |
<Body> |
<Basefont>
- Content Model
- %Text% |
%Anchors% |
%Virtual Formatting% |
%Physical Formatting% |
%Line Break Content% |
%Multimedia Content%
Exceptions:
<img> |
<big> |
<small> |
<sub> |
<sup> |
<font>
Tips & Tricks
- General
- There is a comment in the current HTML 3.2 Draft DTD which lists
support for the WIDTH attribute. It asks: "Does anyone support
this?". Of the Reviewed browsers, none do.
- Application of styles in PRE should not have any effect on the
preservation of spaces.
- Spaces
- All spaces should be preserved.
- Tabs
- "The horizontal tab character (code position 9 in the HTML
document character set) must be interpreted as the smallest positive
nonzero number of spaces which will leave the number of characters so
far on the line as a multiple of 8. Documents should not contain tab
characters as they are not supported consistently." With this
caveat, it is easy to see that the behavior of tabs may be VERY
inconsistent from browser to browser.
- Linefeeds and Carriage Returns
- There are different forms of linefeeds and carriage returns used on
different operating systems. All of them should be preserved.
Browser Peculiarities
- Parent/content behavior of this tag may be very browser-dependent.
Boring Copyright Stuff...