ptg16476052
60 LESSON 4: Learning the Basics of HTML
forming individual nested sections of text. You should be careful never to overlap tags.
That is, never do something like the following:
<!DOCTYPE html><html>
<head>
<body>
</head>
</body>
</html>
Whenever you close an HTML tag, make sure that you’re closing the most recent
unclosed tag. (You’ll learn more about closing tags as you go on .)
In HTML, closing some tags is optional. In fact, in HTML 4.0 and
earlier, closing tags were forbidden in some cases. The XHTML
standard requires your markup to be well-formed XML, which leads
to the requirement that all tags be closed. Because the examples
shown in this book use HTML5, closing tags will be used only when
they are required, but if you are working with XHTML you must
close them.
NOTE
The Title
Each HTML page needs a title to indicate what the page describes. It appears in the title
bar of the browser when people view the web page. The title is stored in your browser’s
bookmarks and in search engines when they index your pages. Use the <title> tag to
give a page a title.
<title> tags are placed within the <head> tag and are normally used to describe the con-
te nts of the page, as follows:
<!DOCTYPE html><html>
<head>
<title>The Lion, The Witch, and the Wardrobe</title>
</head>
<body>
...your page...
</body>
</html>
Each page can have only one title, and that title can contain only plain text; that is, no
other tags should appear inside the title.