Following is a very simplistic example, but shows you another way to exclude an element. It uses the CSS child selector to say, 'anything that is a direct child of the body element will receive this style, and nothing else.' For an a tag, this is a valid approach since the a tag is inline; if a was a block-level element, it would not be valid XHTML 1.0 Strict.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>hello hello hello hello hello</title>
<style>
body > a
{
color:red;
}
</style>
</head>
<body>
<a>hello</a>
<a>hello</a>
<span id="no_class">
<a>hello</a>
</span>
<a>hello</a>
<a>hello</a>
</body>
</html>
NOTE: This does not work in IE7 quirks mode. The DOCTYPE is required. Have not tested with DOCTYPES other than XHTML 1.0 Strict.
I can solve differential equations and build huge databases, but I have no idea how to change my oil.
Bookmarks