HTML and CSS Reference
In-Depth Information
Link Order (LoVe/HAte)
Though covered in Chapter 3, it's worth mentioning again: if your link styles aren't working
properly, check to make sure your rules are properly ordered within your style sheet:
a:link {
color:blue;
}
a:visited {
color:purple;
}
a:hover {
background-color:black;color:white;text-decoration:none;
}
a:active {
background-color:red;color:white;text-decoration:none;
}
Clear All Floats
Floats are cool, as we all know, and they allow us to create all sorts of nice layouts. But forgetting
to clear a float can wreak all kinds of havoc. Always make sure all floated elements are cleared,
either using the easy float clearing method described in Chapter 6, or by inserting a clearing
div immediately following the floated element, or clearing the next element that appears in
the document (see Chapter 7 for some additional clearing methods). You'll save a ton on
headache medicine, and have more time to focus on the real bugs in your layout.
Common CSS Bugs (in IE)
So you know how to avoid problems during development, but that doesn't exempt you from
running into browser bugs during testing, and as you should be familiar with by this point, the
usual troublemaker is IE 6/Win.
Back in Chapter 6, we discussed some popular hacks that solve problems developers run
into with IE. Now we'll put those hacks to good use in order to squash the most common bugs
you'll encounter when testing your layouts in IE 6. It's worth noting that, as of this writing,
these bugs no longer exist in IE 7!
Tip Remember to keep any hacks in a separate style sheet, and serve them to IE 6 and earlier using
conditional comments, as described in Chapter 6.
Search WWH ::




Custom Search