HTML and CSS Reference
THE TOP OF THE HTML5 DOCUMENT
h e i rst four chapters of this topic explain much of how the information above the <body>
tag is put to use. h e code above the <body> tag adds no content to the Web page, but it
inl uences how the page appears and informs the browser that it's a Web page and what kind
of Web page it is. Figure 5-1 shows the general organization of the i rst part of the Web page.
Figure 5-1: Organizing the top of a Web page.
h e <html> tag is the root element, and within that element, you can include a language
attribute. h en within the <head> container are metadata elements. Also in the <head>
container are the scripting elements; they, too, are briel y covered in this section and
expanded upon in Part IV of this topic.
Other than the CSS3 scripts, the examples so far have not put a lot of tags into the head of
the HTML5 document. h e <meta> tag has many uses, but so far, we've used it only to
specify the character set. h is chapter shows more uses for the <meta> tag.
SETTING YOUR HOME BASE
Within the typical Web site, you're likely to have several dif erent pages to which your page
will link. In fact, the typical Web site is arranged as a navigation system that links dif erent
pages. If you set a <base> tag in the head of your page with a link to a URL, you can
reference other pages relative to the base page. For example, the following two scripts
( Base.html and FirstBase.html in this chapter's folder at www.wiley.com/go/
smashinghtml5 ) have links to one another, but they're relative to the base that is set in
the head container.
<! DOCTYPE HTML >
< html >< head >
< base href = ”http://www.sandlight.com/html5/smashing/ “ >
< style type = ”text/css” >