HTML Special Characters

HTML code is punctuated with the < and > characters, butt what if you want to use these symbols as a part of the text on your web page?

Unfortunately, without categorizing these symbols, the web browser won’t show these symbols within the actual body of our pages.

This is why we need to use special code for special characters.

Using special character codes allows the web browser to process the page and display such incompatible symbols in the actual body of your web page without causing any error or potential problem in the HTML coding.

A simple example:

If we wanted to write 8 > 10 on our web page, when the web browser parses > it may not understand that it needs to display it as text as it usually means it’s the opening of an HTML tag.

To be sure the > is always properly shown, see the code below.

There is a long list of special characters and the code used to display them.

Below is an example of some of the popular special characters.

Character Code Description
< &lt; Less than
> &gt; Greater than
& &amp; Ampersand
&quot; Quote marks
  &nbsp; Space
¢ &cent; Cent sign
£ &pound; Pound sign
¥ &yen; Yen sign
© &copy; Copyright symbol
® &reg; Registered trademark
&trade; Trademark
° &deg; Degree symbol
× &times; Multiply
÷ &divide; Divide
¼ &frac14; 1/4 fraction
½ &frac12; 1/2 fraction
¾ &frac34; 3/4 fraction