Search code examples
htmlelementhtml-escape-characters

Special case for &lt and &gt


what would I do if i just randomly wanted to write &lt or &gt in HTML but I don't want to make it appear as a < or >. I understand I can use Javascript but I'm just wondering if there's a way in HTML.

Maybe there is a spacer that separates letters but does not appear in the screen?


Solution

  • You can write & as &amp;, so to answer your question: &amp;lt; and &amp;gt;.