TextArea berücksichtigen
Wer dies über Google findet und nach einer besseren Möglichkeit sucht, die Anzeige seiner Snippets zu verwalten, sollte auch Folgendes in Betracht ziehen <textarea>
die eine umfassende Kontrolle über Breite/Höhe, Bildlauf usw. ermöglicht. Ich stelle fest, dass @vsync den veralteten Tag erwähnt hat <xmp>
finde ich <textarea readonly>
ist ein hervorragender Ersatz für die Anzeige von HTML, ohne dass etwas darin entschlüsselt werden muss (außer wenn </textarea>
erscheinen könnte).
Um zum Beispiel eine einzelne Zeile mit kontrolliertem Zeilenumbruch anzuzeigen, können Sie <textarea rows=1 cols=100 readonly>
Ihre Html-Datei oder andere Dateien mit beliebigen Zeichen, einschließlich Tabulatoren und CrLf's </textarea>
.
<textarea rows=5 cols=100 readonly>Example text with Newlines,
tabs & space,
html tags etc <b>displayed</b>.
However, note that & still acts as an escape char..
Eg: <u>(text)</u>
</textarea>
Zum Vergleich aller...
<h2>Compared: TEXTAREA, XMP, PRE, SAMP, CODE</h2>
<p>Note that CSS can be used to override default fixed space fonts in each or all these.</p>
<textarea rows=5 cols=100 readonly>TEXTAREA: Example text with Newlines,
tabs & space,
html tags etc <b>displayed natively</b>.
However, note that & still acts as an escape char..
Eg: <u>(text)</u></textarea>
<xmp>XMP: Example text with Newlines,
tabs & space,
html tags etc <b>displayed natively</b>.
However, note that & (&) will not act as an escape char..
Eg: <u>(text)</u>
</xmp>
<pre>PRE: Example text with Newlines,
tabs & space,
html tags etc <b>are interpreted, not displayed</b>.
However, note that & still acts as an escape char..
Eg: <u>(text)</u>
</pre>
<samp>SAMP: Example text with Newlines,
tabs & space,
html tags etc <b>are interpreted, not displayed</b>.
However, note that & still acts as an escape char..
Eg: <u>(text)</u>
</samp>
<code>CODE: Example text with Newlines,
tabs & space,
html tags etc <b>are interpreted, not displayed</b>.
However, note that & still acts as an escape char..
Eg: <u>(text)</u>
</code>