diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/html/element%2Fplaintext.html | |
new repository
Diffstat (limited to 'devdocs/html/element%2Fplaintext.html')
| -rw-r--r-- | devdocs/html/element%2Fplaintext.html | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/devdocs/html/element%2Fplaintext.html b/devdocs/html/element%2Fplaintext.html new file mode 100644 index 00000000..62a338bc --- /dev/null +++ b/devdocs/html/element%2Fplaintext.html @@ -0,0 +1,62 @@ +<header><h1><plaintext>: The Plain Text element (Deprecated)</h1></header><div class="section-content"> +<div class="notecard deprecated" id="sect1"><p><strong>Deprecated:</strong> This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the <a href="#browser_compatibility">compatibility table</a> at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.</p></div> <p>The <code><plaintext></code> <a href="../index">HTML</a> element 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.</p> <div class="notecard warning" id="sect2"> <p><strong>Warning:</strong> Do not use this element.</p> <ul> <li> +<code><plaintext></code> is deprecated since HTML 2, and not all browsers implemented it. Browsers that did implement it didn't do so consistently.</li> <li> +<code><plaintext></code> is obsolete; browsers that accept it may instead treat it as a <a href="pre"><code><pre></code></a> element that still interprets HTML within.</li> <li>If <code><plaintext></code> is the first element on the page (other than any non-displayed elements, like <a href="head"><code><head></code></a>), do not use HTML at all. Instead serve a text file with the <code>text/plain</code> <a href="https://developer.mozilla.org/en-US/docs/Learn/Server-side/Configuring_server_MIME_types">MIME-type</a>.</li> <li>Instead of <code><plaintext></code>, use the <a href="pre"><code><pre></code></a> element or, if semantically accurate (such as for inline text), the <a href="code"><code><code></code></a> element. Escape any <code><</code>, <code>></code> and <code>&</code> characters, to prevent browsers inadvertently parsing content the element content as HTML.</li> <li>A monospaced font can be applied to any HTML element via a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS">CSS</a> <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-family"><code>font-family</code></a> style with the <code>monospace</code> generic value.</li> </ul> </div> +</div> +<h2 id="attributes">Attributes</h2> +<div class="section-content"><p>This element has no other attributes than the <a href="../global_attributes">global attributes</a> common to all elements.</p></div> +<h2 id="dom_interface">DOM interface</h2> +<div class="section-content"><p>This element implements the <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement"><code>HTMLElement</code></a> interface.</p></div> +<h2 id="specifications">Specifications</h2> +<div class="_table"><table class="standard-table"> +<thead><tr><th scope="col">Specification</th></tr></thead> +<tbody><tr><td><a href="https://html.spec.whatwg.org/multipage/obsolete.html#plaintext">HTML Standard <br><small># plaintext</small></a></td></tr></tbody> +</table></div> +<h2 id="browser_compatibility">Browser compatibility</h2> +<div class="_table"><table> +<thead> +<tr id="bct-browser-type"> +<th></th> +<th colspan="6">Desktop</th> +<th colspan="6">Mobile</th> +</tr> +<tr id="bct-browsers"> +<th></th> +<th>Chrome</th> +<th>Edge</th> +<th>Firefox</th> +<th>Internet Explorer</th> +<th>Opera</th> +<th>Safari</th> +<th>WebView Android</th> +<th>Chrome Android</th> +<th>Firefox for Android</th> +<th>Opera Android</th> +<th>Safari on IOS</th> +<th>Samsung Internet</th> +</tr> +</thead> +<tbody><tr> +<th><code>plaintext</code></th> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes">4<details><summary>1–4</summary>Before Firefox 4, this element implemented the <code>HTMLSpanElement</code> interface instead of the standard <code>HTMLElement</code> interface.</details> +</td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes">15</td> +<td class="bc-supports-yes">≤4</td> +<td class="bc-supports-yes">4.4</td> +<td class="bc-supports-yes">18</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">14</td> +<td class="bc-supports-yes">≤3.2</td> +<td class="bc-supports-yes">1.0</td> +</tr></tbody> +</table></div> +<h2 id="see_also">See also</h2> +<div class="section-content"><ul> <li>The <a href="pre"><code><pre></code></a> and <a href="code"><code><code></code></a> elements, which should be used instead.</li> <li>The <a href="xmp"><code><xmp></code></a> element, also obsolete, similar to <a href="plaintext" aria-current="page"><code><plaintext></code></a>.</li> </ul></div><div class="_attribution"> + <p class="_attribution-p"> + © 2005–2023 MDN contributors.<br>Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.<br> + <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/plaintext" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/plaintext</a> + </p> +</div> |
