The PRE element indicates text that has been formatted for the
screen and is rendered using a fixed-width font. All whitespace characters
are interpreted literally and retained in display (including multiple
spaces, tabs, carriage returns and linefeeds.) Normally, parsing behavior
in HTML collapses multiple spaces, tabs, CRs, or linefeeds to a single space.
Description:
This attribute helps an author in situations with floating objects (images,
tables, etc.) produced through the Left and
Right ALIGN attributes. It allows content to stop being
flowed around the floated element.
Values: None
[DEFAULT - No special line breaking
effects are applied relative to the floating element.] Left [breaks line after this element
and moves down vertically until the left margin is clear of floated objects.] Right [breaks line after this element
and moves down vertically until the right margin is clear of floated objects.] All [breaks line after this element
and moves down vertically until both margins are clear of floated objects.]
Description:
This attribute specifies the maximum number of characters for a line. If
the preformatted content extends beyond this, a line-wrap is forced.
Description:
This is an SGML Document Access
(SDA) attribute. SDA attributes are designed to transform HTML (and
other SGML-based documents) to the ICADD
DTD - which is used in creating accessible documents for users with
visual disabilities (rendering in Braille, large print, speech
synthesis, etc.) The attribute value specifies the name of the element
to convert this element to in the SDA element group (in this case the
'Lit' element - "literal or computer text".)
Value:Lit (Denotes 'literal or computer text' in SDA.)
Description:
This stand-alone attribute tells the browser to use a pre-formatted mode,
but to use a variable-width font instead of the usual fixed-width font.
Values: NA (HTML); variable (XHTML)
Width
[2|3|3.2|4]
[X1|X1.1]
[IE|M|N6B1|O]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of CSS.
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.
Description:
This stand-alone attribute tells the browser to use a pre-formatted
mode, but to line-wrap the content if it reaches the edge of the screen.
Description:
This is a basic XML syntax that keeps all whitespace characters intact when they are parsed. This is
the XML moral equivalent to the PRE element anyway, so its inclusion for this
element in the standards makes sense.
Values:preserve - maintain all
whitespace characters in rendering and data storage (including multiple
spaces, tabs, carriage returns and linefeeds.)
DTD Note: The HTML specifications have always gone
out of their way to exclude objects and size modifying markup from
PRE content. HTML 4.0 continues this trend, but does not exclude
the IFRAME element. This seems odd since other objects like IMG, APPLET
and OBJECT ARE excluded.
DTD Note: I excluded the NOBR and BLINK elements,
from the PRE content model. These elements are very similar to other
excluded physical markup in the HTML 4.0 DTD.
The HTML 3.2 specification lists support for the WIDTH attribute.
The specification at one time had a note by this attribute asking:
"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
[Test]
"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 element may be very browser-dependent.
Mozilla's documentation speaks of another attribute here called TABSTOP
and I could not get this to work the way I expected it might. Seeing as
there is NO other documentation regarding this attribute anywhere, it
is safe to ignore it.
There was a brief hiccup in Netscape support for the VARIABLE attribute.
It worked all the way through the 4.x series, but wasn't introduced in
Mozilla/Netscape 6 until version 6.1.