0

I have to make a an HTML tutorial. I need to show in the page html code examples. So, I want to have code displayed like this:

 <h1>hi</h1>

not like this

hi

Is there any tag to do this? Or how can I do this only with HTML?

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
aserrin55
  • 350
  • 5
  • 15

1 Answers1

3

You can encode characters to get them to show on a live page. For tags, use &lt; to make a < and &gt; to make >.

<h1>&lt;h1&gt;text&lt;/h1&gt;</h1>

You can see more ways to change various characters when you write HTML at the link below. http://www.escapecodes.info/

JoeL
  • 710
  • 4
  • 18