New Perspectives on HTML and XHTML Tutorial 9 Case Problem 2 Solution
Data Files needed for this Case Problem: cassini.jpg, dtd_list.txt, gargtxt.htm, gbar.jpg, glogo.jpg, maa.jpg, and oneil.jpg
Middle Age Arts Nicole Swanson is the head of the Web site team at Middle Age Arts, a company that creates and sells replicas of historical European works of art for home and garden use. She has recently started a project to update the old HTML code in the site’s many pages. She’s asked you to update the page describing the company’s collection of decorative gargoyles. She wants the page to comply with XHTML 1.0 strict standards. Figure 9-30 shows a preview of the completed Web page.
Complete the following:
1. Use your text editor to open gargtxt.htm from the tutorial.09\case2 folder included with your Data Files. Enter your name and the date in the comment section and save the file as gargoyle.htm in the same file.
2. Insert an XML prolog at the top of the file. Use the standard attribute defaults for an XHTML file.
3. After the XML prolog, insert a DOCTYPE declaration for the XHTML 1.0 strict DTD.
4. Set the default namespace of the document to the XHTML namespace.
5. Test the file on the validator. Fix the errors as follows:
• Convert the attributes for the body element into styles in an embedded style sheet.
(Hint: The link, alink, and vlink attributes are used to set the colors of hyperlinks, active links, and visited links in the Web page.)
• Use proper syntax for any empty elements.
• Set the color and text alignment of an h4 element using an inline style.
• Ensure that all two-sided tags are properly closed.
• Use the float style to align all inline images.
• Use an inline style to set a table cell’s width and background color.
• Remove all deprecated elements and attributes.
6. Save your final version of the file once it passes the validation test for XHTML 1.0 strict, and then test it in your browser to ensure that it looks like Figure 9-30.
7. Submit your completed files to your instructor.