ptg16476052
58 LESSON 4: Learning the Basics of HTML
Structuring Your HTML........................................................................................
HTML defines three tags that are used to define the page’s overall structure and provide
some simple header information. These three tags—<html>, <head>, and <body>—make
up the basic skeleton of every web page. They also provide simple information about the
page (such as its title or its author) before loading the entire thing. The page structure
tags don’t affect what the page looks like when it’s displayed; they’re only there to help
browsers.
The DOCTYPE Identifier
Although it’s not a page structure tag, the XHTML 1.0 and HTML5 standards impose
an additional requirement on your web pages. The first line of each page must
include a DOCTYPE identifier that defines the HTML version to which your page con-
forms, and in some cases, the Document Type Definition (DTD) that defines the
specification. This is followed by the <html>, <head>, and <body> tags. In the fol-
lowing example, the HTML5 document type appears before the page structure tags:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
...your page content...
</body>
</html>
The Tag
The first page structure tag in every HTML page is the <html> tag. It indicates that the
content of this file is in the HTML language. The <html> tag should immediately follow
the DOCTYPE identifier (as mentioned in the previous note), as shown in the following
example.
All the text and HTML elements in your web page should be placed within the beginning
and ending HTML tags, like this:
<!DOCTYPE html>
<html>
...your page...
</html>