To display HTML tags in a website, use their HTML encoding translation.
- Replace the < character with <
- Replace the > character with >
- Replace the & character with &;
You don't actually have to encode the ">" character. That one will show as long as you encode the "<" character. So, you can write <div> without encoding the > as > and it will show like <div> when you write it. The & character you may have to escape in order to show the encoding of other characters. I did this in order to correctly display the information above.
I came across this issue when I was writing another post dealing with the list-style attribute and working with <ol>, <ul>, and <li>. I was like crap, how do I actually show this on the website itself. Damn, I have to encode it. So I looked up the html encoding translations and found this answer.
I'll be sure to add to this list should I come across different encodings that I need to use for this purpose.
Recent Blog Posts
- 4/5 [PhpMyAdmin] Incorrect Format Parameter (Database Import Issue)
- 4/3 [CentOS] How To Check Current Version Of Apache
- 4/3 [Terminal] How To Fix Warning About ECDSA Host Key
- 4/2 [CentOS 8] How To Set Up New Server From A Blank Slate
- 3/25 How I Improved First Contentful Paint And First Meaningful Paint