BCS
BCS

Reputation: 78575

How to escape everything in a block in HTML

I seem to recall that there is an HTML tag that escapes absolutely everything inside it except the matching closing tag. Kind of like <plaintext> but not fundamentally broken.

Upvotes: 11

Views: 11294

Answers (3)

EndangeredMassa
EndangeredMassa

Reputation: 17528

<xmp> is the tag you are looking for:

<xmp>some stuff <tags></tags> too</xmp>

But, since it's depricated, the best you can get is <pre>.

Upvotes: 12

Greg Hewgill
Greg Hewgill

Reputation: 993105

There is also the XML CDATA:

<![CDATA[stuff that is <tag>never</tag> parsed]]>

Whether this works in an HTML document is probably up to the browser. However, it should certainly work in an XHTML document.

Upvotes: 1

Ken Paul
Ken Paul

Reputation: 5765

You need to use <pre><code> ... </code></pre>.

<xmp> is deprecated and should not be used. See http://www.htmlcodetutorial.com/_XMP.html.

Upvotes: 6

Related Questions