Inserting and Formatting Headings The first element in Chief Silva’s page is a centered heading that uses the largest font size for headings. You’ll type the opening tag for the heading, the content of the heading, and then the closing tag for the heading. To create a level-one heading, you will use the tag. To change its alignment to center, you need to add an attribute to the tag. In HTML, you add the align attribute with the center value (), but the center value is deprecated in XHTML. Therefore, to add a code that is compatible with both HTML and XHTML, you will use the style attribute with the text-align: center value (). sidenote Tip: The and tags create a heading with the smallest font size. To add headings to the HTML document: 1 Click the insertion point after the opening tag, and then press the Enter key twice. 2 Type the following line of code: This code creates the heading in the webpage. Now you need to add the attribute to center the heading. 3 Change the opening tag for the heading as follows: 4 Press the End key, press the Enter key twice, and then add the following line of code to the HTML document to create the document subtitle: Now the document includes two headings, both of which will be centered when a browser displays the page. Chief Silva’s page shows that the subtitle should use a red font. To make this change, you will add another attribute to the tag to change the color to red. When using the style attribute, you can separate multiple values with a semicolon. To change font color: 1 Click the insertion point between the word “center” and the closing quotation mark in the tag to position the insertion point between the “r” in “center” and the closing quotation mark. 2 Type ; color: red and then make sure that the opening tag appears as follows: Figure 8-5 shows the revised HTML document. Figure 8-5 Headings and comment added to the HTML document 3 Save the file. As you work in an HTML document, it is a good idea to check your work periodically in a browser to look for coding problems and to make sure that the page you are creating is correct. You can open your HTML document in any browser by using the File menu in the browser. To view the HTML document in a browser: 1 Start Windows Explorer and navigate to the drive and folder where your Data Files are stored. 2 Open the Module.08\Module folder, right-click the women_sd.html file, point to Open with on the shortcut menu, and then click your browser in the list. 3 Your browser displays the webpage that you created. Notice that the headings are centered, the level-two heading is red, and the page title appears on the page tab. The path to the file appears in the browser’s address bar. The page does not use the http:// protocol because the page is stored in a file system and not on a web server. Figure 8-6 shows the page in Chrome. Figure 8-6 Webpage in Chrome As you are working with your HTML document in your text editor, you can save the page and then reload it in the browser to see your updates. Note that you must use your text editor to save the HTML document in order to see all of your changes in the browser when you reload the page. If you reload a page in the browser and do not see your changes, return to your text editor, save the page, and then reload the page again in the browser.