Skip to: content, navigation

by Ian Lloyd

xmp (HTML element)

Spec
Depr. Empty Version
Yes No HTML 2
Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Partial Partial Partial Partial

Example

An example of the xmp showing a stock inventory as it might appear on an 80-column display:

<xmp>
Stock ID    Description             Price         Quantity in Stock
--------    -----------             -----         -----------------
116         Inflatable Armchair     21.50                13
119         Walkie Talkie           40.20                44
</xmp>
Type
block-level element
Contains
inline elements only
Contained by
block-level elements

Description

The xmp element was originally intended for marking up example text as it might appear on 80-column display units. As such displays are no longer the norm and have gone the way of teletype machines and sound as archaic as referring to VDUs (Visual Display Units), it may not be a complete surprise to hear that this is no longer an element that is recommended. It is deprecated, and only partially supported.

xmp is similar to pre in that it honors carriage returns, spaces, tabs and treats markup characters as literal text. It is also a block-level element and will therefore create a line break before the opening <xmp> and the closing </xmp>.

The example shown would render as follows:

Example of xmp element

Use this for…

Text content.

Compatibility

IE5.5Partial
6.0Partial
7.0Partial
Firefox1.0Partial
1.5Partial
2.0Partial
Safari1.3Partial
2.0Partial
3.0Partial
Opera9.2Partial
9.5Partial

Partial browser support for xmp (all browsers tested rendered in fixed width font and honored white space formatting, but none limited the display to 80 columns).

Related Reading

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters