HTML <xmp> tag

Updated: 11/13/2018 by Computer Hope
HTML xmp tag

When writing in HTML (hypertext markup language), the <xmp> tag was used to designate a text section as an HTML example. Anything typed between its opening and closing tags was not interpreted as HTML and was displayed in a monospaced font. The following sections contain information about this tag, including an example of its code and related attributes and browser compatibility.

Warning

The <xmp> tag is deprecated since HTML version 3 because it conflicts with SGML (standard generalized markup language). The <pre> or <code> tags should be used instead. Additionally, if the text in the tag contains the characters < and &, they should be replaced with &lt; and &amp; respectively. For more information, see the HTML3 spec and the W3C's HTML documentation on GitHub.

Example of <xmp> code

<xmp>Itallic font should be marked up using the <i> and </i> tags.</xmp>

Attributes

All HTML tags support standard attributes that define the settings of an HTML element. Unlike other HTML tags, the <xmp> tag has no unique attributes.

Compatibility

Edge Internet Explorer Firefox Safari Opera Chrome
Not supported Not supported Not supported Not supported Not supported Not supported

Browser, Code, Compatibility, Container tag, Optimized, Web design terms