Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What was the <XMP> tag used for?

Tags:

html

tags

Does anyone remember the XMP tag?

What was it used for and why was it deprecated?

like image 274
GateKiller Avatar asked Aug 07 '08 09:08

GateKiller


People also ask

How do you use code tags?

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).

What does pre tag mean in HTML?

The <pre> HTML element represents preformatted text which is to be presented exactly as written in the HTML file.

How do you print text in HTML?

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.


1 Answers

XMP and PRE differ. Content within PRE tags is formatted as follows:

  • Content is shown with a fixed font,
  • All whitespace is preserved, and
  • Each line break begins a new line.

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.

like image 89
dadinck Avatar answered Oct 04 '22 03:10

dadinck