Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
432 views
in Technique[技术] by (71.8m points)

html - What was the <XMP> tag used for?

Does anyone remember the XMP tag?

What was it used for and why was it deprecated?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...