Home > front end >  How to display HTML entities on page
How to display HTML entities on page

Time:01-14

I am trying to get an HTML entity to display to the page without showing up as the symbol it represents. EX: I want to have &#60 show up on the screen instead of <. I am doing this inside of a code window that I created on my page to show how HTML entities are used in the code itself. Is there a way that I can do this in HTML and if so how would I go about doing this?

<pre> <code> &#60 </code> </pre>

CodePudding user response:

To display HTML entities on a page, you can use the &# notation followed by the entity's numerical code. For example, to display the 'less than' (<) symbol on a page, you would use the code &#60;. If you are including the code inside of a code window, you may need to use HTML character entities in order to prevent the browser from interpreting the code as a tag. For example, you would use &amp;#60; to display the 'less than' symbol.

  • Related