Loading lessons...
HTML Entities
HTML Entities
Some characters are special in HTML, and some can't be typed easily. HTML entities solve both problems!
What is an entity?
An entity is a special code that stands for a character. It starts with & and ends with ;.
< stands for <
> stands for >
& stands for &
The big three you MUST know
If you write < or > directly in text, the browser might think you're writing a tag! Use entities instead:
<p>2 is less than < 3</p>
<p>5 is greater than > 4</p>
<p>Tom & Jerry</p>
More useful entities
": double quote"'(or'): single quote' : a non-breaking space (keeps words together!)©: copyright©®: registered®™: trademark™€: euro sign€£: pound sign£¥: yen sign¥
Non-breaking space ( )
is a space that never lets the words split across lines. Use it to keep "10 km" or "Chapter 5" together.
<p>It's about 10 km away.</p>
Number entities
You can also use numbers: A is the character number 65, which is "A".
<p>A is the letter A</p>
TL;DR
- Entities start with
&and end with;. - Use
<,>,&for<,>,&. is a space that keeps words together.©,€,®and friends type special symbols.- Number entities like
Ause character numbers.