HTML and CSS Reference
In-Depth Information
figure 9-22
Results of the XHtML 1.0 strict validation test
Five errors are reported by the W3C validator page. The first two are:
Line 28, column 14 : there is no attribute “bgcolor”
ƒƒƒƒƒƒ<bodyƒbgcolor= white”>
Line 31, column 55 : there is no attribute “align”
ƒƒƒƒƒƒ<imgƒsrc=”logo.jpg”ƒalt=”WizardƒWorks”ƒalign= left”ƒ/>
Both errors reference presentational attributes that are not supported under the
XHTML 1.0 strict DTD. The first attribute, bgcolor , is used to set the background color
of the Web page. The align attribute referenced in the second error message is used to
float the inline image on the left page margin. You can fix both errors by removing the
attributes and replacing them with style properties.
To replace the attributes with styles:
1. Return to the works.htm file in your Web browser, and then delete the attribute
from the opening <body> tag.
2. Go down two lines in the file, and then delete the attribute
from the <imgƒ/> tag for the logo.jpg file.
3. Scroll down the file, and then delete the attribute
from the <imgƒ/>ƒ tag for the firework.gif graphic.
4. Save your changes to the file, and then open the ww.css file in your text editor.
5. Add the following style rule to the body element to replace the actions of the
bgcolor attribute you deleted in Step 1:
6. Within the style rule for the #headƒimg selector, add the following property to
float the image on the left margin:
7. Next, add the following style rule to float inline images within the #main selector
on the right margin:
Figure 9-23 highlights the revised code in the style sheet file.
Search WWH ::

Custom Search