How To Write HTML Entities

People use HTML entities to draw tags and reserved characters that are not available through keyboard stroke. However, when we need to show an entity code to our audience, it might be a little tricky. In browsers, an entity code draws certain reserved character while hiding itself. We need a trick to show the codes in browsers.

Just in case, What is HTML Entities?

Back to topic, the trick is we need to write the entity codes using entities itself. It also means we avoid browsers to be interpreting the codes as "real" entity codes. Therefore, they will only show the codes, instead of processing it.

For example, let's say we want to write € that is the responsible codes for .

Then we need to alter some elements of the code € to avoid being interpreted as real a entity code and show it on our post / articles. So, let’s start with the ' & ', we can draw this character by the entity codes & . Therefore:
To show € we need to write it € (in our post)
There is another method of altering the elements of the code: changing the ' ; ' with its entity code &#59; . However, this code is an entity number, which means even old browsers support it, but new publishing / blogging platforms might not. Therefore:
To show € we need to write it &euro&#59; (in our post)
If you use Blogger, I suggest using the ampersand-changing method (the first), because it does not support entity numbers. If you write ones, they will be transformed to its characters permanently.

I have not found the entity names for the character ' ; ' even on W3C (WWW Consortium) official website. If you know it, please share it on the comments.

No comments: