过时
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 Plaintext Element ( <plaintext> ) renders everything following the start tag as raw text, ignoring any following HTML. There is no closing tag, since everything after it is considered raw text.

注意: Do not use this element.
  • <plaintext> is deprecated since HTML 2, and not all browsers implemented it. Browsers that did implement it didn't do so consistently.
  • <plaintext> is obsolete in HTML5; browsers that accept it may instead treat it as a <pre> element that still interprets HTML within.
  • <plaintext> is the first element on the page (other than any non-displayed elements, like <head> ), do not use HTML at all. Instead serve a text file with the text/plain MIME-type .
  • Instead of <plaintext> ,使用 <pre> element or, if semantically accurate (such as for inline text), the <code> element. Escape any < , > and & characters, to prevent browsers inadvertently parsing content the element content as HTML.
  • A monospaced font can be applied to any HTML element via a CSS font-family 样式采用 monospace generic value.

属性

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

DOM 接口

This element implements the HTMLElement 接口。

Implementation note: In Gecko 1.9.2 and before, Firefox implements the interface HTMLSpanElement 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
plaintext 弃用 Chrome 完整支持 Yes Edge 完整支持 12 Firefox 完整支持 4
完整支持 4
部分支持 Partial 注意事项
注意事项 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 完整支持 4 Opera Android 完整支持 Yes Safari iOS 完整支持 Yes Samsung Internet Android 完整支持 Yes

图例

完整支持

完整支持

弃用。不要用于新网站。

弃用。不要用于新网站。

见实现注意事项。

见实现注意事项。

另请参阅

元数据

  • 最后修改: