HTML and CSS Reference
In-Depth Information
3. Replace the value in the input box with &reg ; and then click the Show button. The
browser now displays the ® symbol, the symbol for registered trademarks, which
you specified using a character entity reference.
You can also view a collection of numeric character references and character
entity references by selecting a table from the list box on the page.
4. Verify that General Symbols is displayed in the selection list box, and then click
the Show Table button. As shown in Figure 1-44, the browser displays a list of
35 symbols with the character entity reference and the numeric character refer-
ence displayed beneath each symbol.
Figure 1-44
HTML characters demo page
character entity reference
character symbol
sym b ol
numeric c h aracter reference
c haracter entity reference
5. Take some time to explore the variety of numeric character references and char-
acter entity references supported by your browser. Close the demo page when
you're finished, but leave your browser open.
Special Characters
One use of character codes is to insert text about HTML itself. For example, if you want
your Web page to describe the use of the <h1> tag, you cannot simply type
The <h1> tag is used to mark h1 headings.
because browsers would interpret the <h1> text as marking the beginning of an h1
heading! Instead, you have to use the &lt ; and &gt ; entity references to insert the < and
> symbols. The text would then be:
The &lt;h1&gt; tag is used to mark h1 headings.
Another use of character codes is to add extra spaces to your Web page. Remember
that browsers ignore extra blank spaces in an HTML file. To insert an additional space,
use the &nbsp ; entity reference ( nbsp stands for nonbreaking space ), which forces
browsers to insert an extra space.
Search WWH ::

Custom Search