Web design software - 1434 Introduction to XHTML: Part 1 Appendix K

1434 Introduction to XHTML: Part 1 Appendix K An XHTML document divides the htmlelement into two sections head and body. Lines 9 11 define the Web page s head section with a head element. Line 10 specifies a title element. This is called a nested element, because it is enclosed in the head element s start and end tags. The headelement also is a nested element, because it is enclosed in the html element s start and end tags. The title element describes the Web page. Titles usually appear in the title bar at the top of the browser window and also as the text identifying a page when users add the page to their list of Favorites or Bookmarks, which enable users to return to their favorite sites. Search engines (i.e., sites that allow users to search the Web) also use the titlefor cataloging purposes. Good Programming Practice K.3 Indenting nested elements emphasizes a document s structure and promotes readability. Common Programming Error K.3 XHTML does not permit tags to overlap a nested element s end tag must appear in the document before the enclosing element s end tag. For example, the nested XHTML tags cause a syntax error, because the enclosing head element s ending tag appears before the nested title element s ending tag. Good Programming Practice K.4 Use a consistent title naming convention for all pages on a site. For example, if a site is named Bailey s Web Site, then the title of the main page might be Bailey s Web Site Links . This practice can help users better understand the Web site s structure. Line 13 opens the document s body element. The body section of an XHTML document specifies the document s content, which may include text and tags. Some tags, such as the paragraph tags (

and

) in line 14, mark up text for display in a browser. All text placed between the

and

tags form one paragraph. When the browser renders a paragraph, a blank line usually precedes and follows paragraph text. This document ends with two closing tags (lines 15 16). These tags close the body and html elements, respectively. The ending tag in an XHTML document informs the browser that the XHTML markup is complete. To view this example in Internet Explorer, perform the following steps: 1. Copy the Appendix K examples onto your machine from the CD that accompanies this book (or download the examples from www.deitel.com). 2. Launch Internet Explorer, and select Open… from the File Menu. This displays the Open dialog. 3. Click the Open dialog s Browse… button to display the Microsoft Internet Explorer file dialog. 4. Navigate to the directory containing the Appendix K examples and select the file main.html; then, click Open. 5. Click OK to have Internet Explorer render the document. Other examples are opened in a similar manner. At this point your browser window should appear similar to the sample screen capture shown in Fig. K.1. (Note that we resized the browser window to save space in the book.)
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Leave a Reply