Qbasicnews.com

Full Version: CSS Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If I want to have a different link-hover color for one table and a different link-hover color for another, how would I do that?
For something as simple as text coloring, I'd just specify td.specs {color: #rrggbb}, but I can't nest {}'s, right?
Like, I can't do this:
td.specs {a:hover{color:#rrggbb;};}
Right?

So, is it possible? If so, how?
I don't think it's possible, but I've never tried it. The thing I'd do is just create another class a.classname:hover and use it (I'm not sure if it's a.cn:hover or a:hover.cn)
Yeah, you have to create several classes....one class for this color, and a second class for another color....then you can do this....
*nods* Classes are the way to go, here.
You can make classes and ids, so you can assign two different behaviors to one tag.
Thanks, guys. I'll give it a shot when I have time.
Humm... I normally stay away from this forum... but with CSS questions, how can I resist?

For two different table hover styles:

table.tab1 a:hover {color: #rrggbb;}
table.tab2 a:hover {color: #rrbbgg;}

So you just have a space between them. This is known as a descendant selector, in the old CSS1 it was known as a contextual selector.