Web Development
Learn HTML5
HTML Entities

HTML Entities

HTML possesses some reserved characters. For example, if you want to display a mathematical expression where one number is greater than the other, you might do something like this:

8 > 2

However, this might not be the best method because you never know whether the browser will take the ">" symbol and interpret is as a tag. The solution to this is to use HTML Entities.

HTML Entities are used to display reserved characters. For example, the "greater than" symbol will now become >

Example:

8 > 2

The code snippet above is going to render: 8 > 2 just like in the first example.

It might not make sense when typing it in for the first time, but the browser is going to understand what you mean, and with time, you will get used to using HTML Entities.

Other examples include:

  1.   - is going to render a non breaking space
  2. © - is going to render ©
  3. " - is going to render "
  4. ® - is going to render ® (Registered trademark)
  5. &lt; - is going to render <

HTML Entities start with & and end with a ;.

A complete reference for you is on this link (opens in a new tab)