Creating the HTML Document Structure In addition to saving the file with the .html filename extension, you must also create the document structure. As shown in the Session 8.1 Visual Overview, every HTML document includes an opening tag to indicate that the file is an HTML document. After this opening tag, you need to define the head and body sections of the HTML document. A good practice is to start your HTML document by typing the opening and closing tags that create the head and body sections. If you always type your two-sided tags in pairs, you won’t make a common beginner’s mistake, which is typing the opening tag and then forgetting to type the closing tag. To create the head and body sections: 1 Make sure the insertion point is on the first line of the new document. 2 Type the content shown in Figure 8-4 in your HTML document, using lowercase letters for the tags and mixed-case letters for the content. Press the Enter key twice at the end of each line to create the blank lines shown in the figure. Figure 8-4 Basic HTML document structure shown in Notepad Trouble? The figures show the documents in Notepad. Your window might look slightly different from the ones shown in the figures if you are using another version of Notepad or another text editor, but this difference should not cause any problems. 3 Click File on the menu bar, and then click Save. Your HTML document has the required head and body sections and a title. Because the browser displays the title on the page tab and also uses it as the default name when you use the browser to save the page as a bookmark or favorite, it is important to use a title that effectively describes the webpage’s content. The blank lines you inserted are not necessary for browsers to interpret the HTML document. In fact, browsers ignore white space in an HTML document, the same way they ignore the blank spaces between sections. This white space, however, makes the HTML document easier to read. Insight Using a Document Type Declaration In the steps and assignments in this module, you won’t include a document type declaration at the beginning of your HTML documents because it is beyond the scope of this book. A document type declaration (DTD) is a one-sided tag that tells a browser which syntax version of a markup language your document uses. When you omit the document type declaration in an HTML document, the browser renders the page using Quirks mode. In Quirks mode, a browser will render most basic content correctly. If you later decide to take a course on HTML, XHTML, or XML programming, you will learn that you should always include the correct DTD in your documents so browsers will render their elements according to the latest standards. When you create XHTML documents, the DTD is required; in HTML documents it is strongly recommended but optional. You can learn more about DTDs at the W3C Schools site (www.w3schools.com/xml/xml_dtd_intro.asp).