HTML and CSS Reference
In-Depth Information
to the document head, where character_set is the name of the character set you want
the browser to employ when interpreting your HTML code. Under HTML5, the meta ele-
ment is simply:
<meta charset=” character_set ” />
HTML5 also supports the syntax of the HTML 4.01 and XHTML meta element. You
should always specify the character encoding in your document, even if you are not
using any special symbols. It relieves the browser from having to guess about the correct
encoding; and in certain situations, not specifying the encoding can lead to a security
hole in the transfer of a page from the Web server to the client.
You'll add the meta element to Dave's document to specify that his fi le has been
encoded using the UTF-8 character set.
The meta element is also
used to store information
and keywords describing a
document and its purpose.
To specify the character encoding for Dave's document:
1. Return to the jprop.htm file in your text editor.
2. Scroll to the top of the file. Directly below the comment in the head section, insert
the following meta element as shown in Figure 1-47:
<meta charset=”UTF-8” />
Figure 1-47
Specifying the character encoding
character set
3. Close the jprop.htm file, saving your changes.
4. Refresh the jprop.htm file in your browser and verify that the browser renders the
page with no errors.
Search WWH ::

Custom Search