HTML and CSS Reference
In-Depth Information
Programmatically Check Syntax Errors. As mentioned earlier, you can use the
W3C's CSS Validator at http://jigsaw.w3.org/css-validator to verify your syntax.
Configure Temporary Background Colors. Sometimes your code is valid but the
browser window is not configured the way you would expect. If you temporarily
assign distinctive background colors such as red or yellow and test again, it
should be easier to see where the “boxes” are ending up.
Configure Temporary Borders. Similar to the temporary background colors, you
could temporarily configure an element with a 3 pixel red solid border—this will
really jump out at you and help you recognize the issue sooner.
Use Comments to Find the Unexpected Cascade. Styles and XHTML attributes con-
figured farther down the page can override earlier styles. If your styles are misbe-
having, try commenting out (see below) some styles and test with a smaller group
of statements. Then add the styles back in one by one to see where or when the
breakdown occurs. Work patiently and test the entire style sheet in this manner.
Note that Comment Areas Are Ignored by Browsers. A style sheet comment begins
with /* and ends with */. Comments can span multiple lines. A code snippet with CSS
comments follows:
/* Set Page Margins to Zero */
body { margin: 0
}
/* temporarily commented out during testing
.nav { text-decoration: none;
}
*/
The first comment is used to document the style sheet and describe the style applied to
the body tag. The second comment spans multiple lines. It begins on the line above the
nav class and ends on the line below the nav class. This causes the browser to skip the
nav class when applying the style sheet. This technique can be useful in testing when
you are experimenting with a number of properties.
6.7 CSS Page Layout Resources
This chapter introduces you to using CSS for page layout configuration and should get
you started in your exploration of this technology. It may help you to know that you
are not alone in your quest to learn CSS. There are many resources with documenta-
tion, tutorials, and support for this technology. The page layout techniques discussed in
this textbook are just an introduction to using this technology. There are many Web
sites that offer additional insight and techniques for configuring page layout with CSS.
The following are a few that you may find useful:
http://glish.com/css
Large collection of CSS page layouts and links to tutorials
http://www.websitetips.com/css/index.shtml
Comprehensive list of tutorials and CSS-related sites
http://www.meyerweb.com/eric/css
The site of Eric Meyer, a leading-edge Web developer
 
Search WWH ::




Custom Search