Entity References
HTML has a limited set of allowed characters. This is due to the way that HTML has evolved to be displayed on various different computers, fonts and character encodings. If we want to use special characters in HTML we need to use entity references. For example, to display a copyright sign we need to use the entity ©. Note the semicolon.
Value | Entity Reference | Output |
---|---|---|
Copyright sign | © | © |
Pound sign | £ | £ |
Ampersand | & | & |
Left Double Quotes | “ | “ |
Right Double Quotes | ” | ” |
No Breaking Space | |
There are many more, far too many to list here. If you need a specific reference, Google “html entity reference” to find a very long list.
Exercise - Entity References
Use this document:
"Time and Tide wait for no man." Copyright Chaucer 1390
- Enter the document and save it as html.
- Increase the text size of the quote.
- Replace the word “and” with an ampersand character.
- Wrap the quote in pretty double quotes.
- Replace the word copyright with a copyright character.
- Put the quote in a nice serif font like Georgia.
- Change the colour of the quote to a pale grey
- Align the quote in the center of the page.