Preformatted Text

Support Key: [2|3|3.2|4] [X1|X1.1] [IE1|M1|N1|O2.1]
What is it?
Attributes
Tag Example
Parent/Content Model
Tips & Tricks
Browser Peculiarities
= Index DOT Html by Brian Wilson =
Main Index | Element Tree | Element Index | HTML Support History



   Quick Statistics   
End Tag:
   Required
Standards Details:
In all HTML 4.x/XHTML DTDs
XHTML Modules:
Text
CSS 'display' Type:
"block"
CSS Mapping:
font-family: monospace, white-space: pre
Default Rendering:
Fixed-width font, all spacing, line-feeds, etc. preserved on output
Official Docs:
HTML 4.x, XHTML 1.1

What is it?
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.

Common Attributes
%Core%
[2|3|3.2|4] [X1|X1.1] [IE3|M|N4B2|O3.5]
%Accessibility%
[2|3|3.2|4] [X1|X1.1] [IE4B1|M|N6|O5]
%Events%
[2|3|3.2|4] [X1|X1.1] [IE4B1|M|N6B1|O4]
%Language%
[2|3|3.2|4] [X1|X1.1] [IE4|M|N6B1|O]
%Editing%
[2|3|3.2|4] [X1|X1.1] [IE5.5|M|N|O]

Specific Attributes
Clear
[2|3|3.2|4] [X1|X1.1] [IE4|M|N|O4-6.x]
Standards Details: NA
Required? No
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.]
Cols
[2|3|3.2|4] [X1|X1.1] [IE|M|N4|O]
Standards Details: NA
Required? No
Description:
This attribute specifies the maximum number of characters for a line. If the preformatted content extends beyond this, a line-wrap is forced.
Values: Positive integer values
SDAForm
[2|3|3.2|4] [X1|X1.1] [IE|M|N|O]
Standards Details: NA
Required? No
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.)
VARIABLE
[2|3|3.2|4] [X1|X1.1] [IE|M|N2|O]
Standards Details: NA
Required? No
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.
Values: Positive integer values
WRAP
[2|3|3.2|4] [X1|X1.1] [IE|M|N3|O]
Standards Details: NA
Required? No
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.
Values: NA (HTML); wrap (XHTML)
xml:space
[2|3|3.2|4] [X1|X1.1] [IE|M|N|O]
Standards Details: Intrinsic part of XML
Required? No
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.)
Example
<pre>
     this     is    a    test
</pre>
Parent Model
%Block Parent%
Content Model
%In-line Content%
Exceptions: <applet> | <basefont> | <big> | <blink> | <font> | <iframe> | <img> | <nobr> | <object> <small> <sub> <sup>
Tips & Tricks
General
Spaces
Tabs
Linefeeds and Carriage Returns
Browser Peculiarities
Boring Copyright Stuff...