3

I want to display this code, in my website:

<title>MY_TITLE</title>

I tried to use the <pre> and <code> tags without success. Its wrote that I can't use title tags on those tags.

Again, I want to display this code (This code shouldn't do nothing). Any suggestions?

Andriy Ivaneyko
  • 20,639
  • 6
  • 60
  • 82
Web R
  • 565
  • 1
  • 6
  • 23

2 Answers2

4

If you want to display and show HTML code on a web page so that it is not executed, you need to convert the < and > into it's ascii equivalent of &lt; and &gt;

Try following

&lt;title&gt;MY_TITLE&lt;/title&gt;
Andriy Ivaneyko
  • 20,639
  • 6
  • 60
  • 82
Nikhil Aggarwal
  • 28,197
  • 4
  • 43
  • 59
1

<title> MY_TITLE </ title> This code has to go inside label "<![CDATA[ "-->code here<--" ]]>"

https://stackoverflow.com/a/7092306/4504069

Community
  • 1
  • 1