过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

摘要

HTML Example Element ( <xmp> ) renders text between the start and end tags without interpreting the HTML in between and using a monospaced font. The HTML2 specification recommended that it should be rendered wide enough to allow 80 characters per line.

注意: Do not use this element.
  • It has been deprecated since HTML3.2 and was not implemented in a consistent way. It was completely removed from the language in HTML5.
  • 使用 <pre> element or, if semantically adequate, the <code> element instead. Note that you will need to escape the ' < ' character as ' < ' to make sure it is not interpreted as markup.
  • A monospaced font can also be obtained on any element, by applying an adequate CSS style using monospace as the generic-font value for the font-family 特性。

属性

This element has no other attributes than the 全局属性 , common to all elements.

DOM 接口

This element implements the HTMLElement 接口。

Implementation note: up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement interface for this element.

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
xmp 弃用 Chrome 完整支持 Yes Edge 完整支持 12 Firefox 完整支持 Yes 注意事项
完整支持 Yes 注意事项
注意事项 Before Firefox 4, this element implemented the HTMLSpanElement interface instead of the standard HTMLElement 接口。
IE 完整支持 Yes Opera 完整支持 Yes Safari 完整支持 Yes WebView Android 完整支持 Yes Chrome Android 完整支持 Yes Firefox Android 完整支持 Yes 注意事项
完整支持 Yes 注意事项
注意事项 Before Firefox 4, this element implemented the HTMLSpanElement interface instead of the standard HTMLElement 接口。
Opera Android 完整支持 Yes Safari iOS 完整支持 Yes Samsung Internet Android 完整支持 Yes

图例

完整支持

完整支持

弃用。不要用于新网站。

弃用。不要用于新网站。

见实现注意事项。

见实现注意事项。

另请参阅

元数据

  • 最后修改: