Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1
Lesson 1: Introducing HTML5 CHAPTER 2 41

</body>
</html>

In this example, the <meta> element describes the character set as utf-8, which is an effi-
cient form of unicode in which the English language characters (ASCII) require only a single
byte to be represented, and in which other languages can have characters that are repre-
sented with up to 4 bytes. This is the most common character set used in HTML and XML
documents.
This example also contains a <title> element, which is important because it serves the fol-
lowing purposes.
■■Displays in the browser toolbar
■■Provides the default name for the page when it is added to favorites
■■Displays the title when a search engine displays the page in the search results
The <body> tag contains the displayable contents.

Using special characters (HTML entities)
You might want to display the < and > characters on your webpage, but you’ve seen that the
less-than and greater-than characters define tags. These characters can be displayed in your
content by using either the entity name or entity number as follows.
&entity_name;
or
&#entity_number;
There are many HTML entities, but Table 1-1 lists the most common HTML entities you will
use in your HTML document.

TABLE 1-1 eference to common entitiesR

Display Entity Name Entity Number Description
& & & Ampersand
> > > Greater-than sign
< < < Less-than sign
“ " " Double quotation
© © © Copyright
® ® ® Registered trademark
™ ™ ™ Trademark
  $#160; Nonbreaking space

Key
Te rms

Free download pdf