HTML and CSS Reference
In-Depth Information
I was just creating a web page
explaining everything I was learning from
this topic, and I wanted to mention the <html>
element inside my page. Isn't that going to
mess up the nesting? Do I need to put double
quotes around it or something?
You're right, that can cause problems.
Because browsers use
<
and
>
to begin and end tags, using them in
the content of your HTML can cause problems. But HTML gives
you an easy way to specify these and other special characters using
a simple abbreviation called a
character entity
. Here's how it works:
for any character that is considered “special” or that you'd like to
use in your web page, but that may not be a typeable character
in your editor (like a copyright symbol), you just look up the
abbreviation and then type it into your HTML. For example, the
>
character's abbreviation is
>
and the
<
character's is
<
.
So, say you wanted to type “The
<html>
element rocks.” in your
page. Using the character entities, you'd type this instead:
The
<
html
>
element rocks.
Another important special character you should know about is the
&
(ampersand) character. If you'd like to have an
&
in your HTML
content, use the character entity
&
instead of the
&
character
itself.
So what about the copyright symbol (that's ©right;)? And
all those other symbols and foreign characters? You can look up
common ones at this URL:
http://www.w3schools.com/tags/ref_entities.asp
or, for a more exhaustive list, use this URL:
http://www.unicode.org/charts/