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
  • 18,421
  • 4
  • 52
  • 73
Web R
  • 580
  • 1
  • 5
  • 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
  • 18,421
  • 4
  • 52
  • 73
Nikhil Aggarwal
  • 27,657
  • 4
  • 40
  • 56
1

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

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

Community
  • 1
  • 1