<xmp>
xmp tag
The <xmp>
tag displays the text between its opening and closing tags as plain text, without rendering any HTML inside, and uses a monospaced font.
Syntax
<xmp>
Your content goes here, including <tags> that won't be interpreted.
</xmp>
xmp
Demo
- As
<xmp>
is deprecated, it’s advisable to avoid using it in current web development practices.
<xmp>
<p>This is some HTML code that will not be rendered as a paragraph.</p>
</xmp>
This is how you'd display code nowadays.
<pre>
<code>
<p>This is how you'd display code nowadays.</p>
</code>
</pre>
Attributes
This element only supports global attributes that apply to all HTML elements.
DOM Interface
This element implements the HTMLElement interface.
See also
- The
<pre>
and<code>
elements as alternatives. - The
<plaintext>
and<listing>
elements, which are similar to<xmp>
but also obsolete.
Conclusion
The <xmp>
tag in HTML is deprecated and should no longer be used in modern web development. It was originally used to display text as plain text, without interpreting HTML inside it. Today, the <pre>
and <code>
tags are recommended alternatives for displaying code or preformatted content. These modern elements provide better structure and are more aligned with current HTML standards.
<wbr>
The HTML <wbr> element indicates a potential line break within text, enabling the browser to break the line at that location if necessary, thereby enhancing text wrapping and readability.
Lists
Lists in HTML organize content into ordered (<ol>), unordered (<ul>), and definition (<dl>) lists, with items defined using (li>) or(dt>/<dd>) or enhancing content structure and readability.