Have you ever wondered how people display actual HTML on a page? I mean if they were typing in HTML, wouldn't it actually show how it was meant to?
If you are wanting to display the HTML on the page, you will need to use different characters to prevent the information from showing as working HTML.
If I typed it exactly how it looked then all that would show is:
To show the actual source I have used escape characters:
Most of these sets of characters start with the '&' and end with the ';'. Below is a list of 'Escape Characters' that you may want to use if you are wanting to display HTML Source on your pages. |
The Character | Will look like | Use the Text | or Code |
The Ampersand | & | & | & |
Less-than sign | < | < | < |
Greater-than sign | > | > | > |
Quotation Mark | " | " | " |
Non breaking space | |   | |
Registered Trademark | ® | ® | ® |
Copyright Sign | © | © | © |