Programming & Scripting Tutorials

HTML & CSS: Special Characters

When writing content in HTML, sometimes there are symbols you just can't (or shouldn't) write as they are reserved characters by the language. If you wanted to write something using angle brackets for example (like I have to with almost every one of my HTML/CSS tutorials), you can't write them in the usual way as they are part of the HTML language itself. The secret to accomplishing this is using special codes, which represent certain characters – these are called character entities or character codes.


Character Entities

So this is going to be a bit drab and linear, but the rest of this tutorial is pretty much just going to contain some of the most common symbols and their character entities. Any symbol can be written using a specific number or using it's name. The syntax is either &character_name; or &#character_number;. For example an ampersand ('&' sign) can be written by writing &, or writing &. A list of some of the most common symbols and how they're written in HTML is below:

If you want a comprehensive list, there are a whole bunch of pages that can give you a list – something like this should do fine. This tutorial was sort of just to let you know about them and give you some basic codes - they are sort of important when creating webpages for production.

So if you wanted to write a <br/> tag on your page (as I commonly do) without it being treated as HTML – you could write something like the following:

&#60;br/&#62;

If you look at any of these tutorials, you should see that I use character codes a whole lot.

This HTML & CSS tutorial was written by


Back to HTML & CSS

Advertisement: