How can I display html tags inside an HTML document?

Ariel picture Ariel · Mar 23, 2011 · Viewed 26.8k times · Source

I simply want to create something like that:

<strong>blah blah</strong>

I've been trying to do this for a long time though for some reason whenever I put the code and the pre tags they don't do what they should. They do unformat the content - I don't see any formatting, though the tags don't appear. For example, I wrote :

<pre><b>abc</b></pre>

The abc is appearing not bold, but I can't see the tag itself. How can I do that? I don't want to use entities like &fdaf because I am not writing the incoming text

Answer

Fuzzy Analysis picture Fuzzy Analysis · Jun 1, 2013

Use the <xmp> tag, e.g.

<xmp>
  <html>
    <body>This is my html inside html.</body>
  </html>
</xmp>

You can also add styles and formatting inside <xmp> as well.