In article <op**************@news.individual.net>,
ne*****@yahoo.com
says...
Why is the title still underlined when I specify the class of the A tag?
To set a style for a with class "title", use the selector a.title { ... }.
I had actually tried that, and it didn't work, but that's because before
I simplified the example for posting, the code was actually something
like
<div class="blogbody">
<a href="link"><h2 class="title">title</h2></a>
</div>
Which as I now see is a very, very different case.
So 'a.title' isn't appropriate, since it's not an 'a' of class "title".
And '.title a' isn't either, since the 'a' isn't a descendant of an
element with class "title"; in fact, it's the other way around. I have
now also tried overriding borders in 'a .title' or 'a *.title', but that
doesn't seem to work either... any ideas why? Reading the spec, I'd
think that should work. The workaround is obvious, of course, but I'd
like to understand what I'm doing wrong...
For reference, the complete code is now:
<html>
<head>
<style type="text/css">
<!--
a {text-decoration: none; }
..blogbody a { border-bottom: 1px solid #668;}
..title { font-size: 200%;}
a.title { border-bottom: 0px none #668; }
..title a { border-bottom: 0px none #668; }
a *.title { border-bottom: 0px none #668; }
-->
</style>
</head>
<body>
<div class="blogbody">
<a href="test">blogbody div</a><br />
<a href="test" class="title">title href in blogbody div</a><br />
<span class="title">
<a href="test"><h2>title outer span in blogbody div</h2></a>
</span>
<a href="test"><h2 class="title">title h2 in blogbody div</h2></a>
<a href="test"><span class="title">title span in blogbody div</span>
</a>
</div>
</body>
</html>
--
Jay Levitt |
Wellesley, MA | Hi!
Faster: jay at jay dot eff-em | Where are we going?
http://www.jay.fm | Why am I in this handbasket?