Does anyone remember the XMP
tag?
What was it used for and why was it deprecated?
The <code> tag is used to define a piece of computer code. The content inside is displayed in the browser's default monospace font. Tip: This tag is not deprecated. However, it is possible to achieve richer effect by using CSS (see example below).
The <pre> HTML element represents preformatted text which is to be presented exactly as written in the HTML file.
Text in a <pre> element is displayed in a fixed-width font, and the text preserves both spaces and line breaks. The text will be displayed exactly as written in the HTML source code.
XMP
and PRE
differ. Content within PRE
tags is formatted as follows:
If you want to include special characters such as <
, >
and &
within PRE
tags, they must be escaped so that they are not subject to special interpretation by the browser.
In contrast, content within XMP
tags does not need to be escaped.
The only character sequence that cannot be included within XMP
tags is the XMP
end tag (</XMP>
).
XMP
is still supported by the browsers I have tested. You can try it with xmp.html. View the source to see the tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With