Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSS Question
#1
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?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#2
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)
am an asshole. Get used to it.
Reply
#3
Yeah, you have to create several classes....one class for this color, and a second class for another color....then you can do this....
B 4 EVER
Reply
#4
*nods* Classes are the way to go, here.
size=9]"To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public." -- Theodore Roosevelt[/size]
Reply
#5
You can make classes and ids, so you can assign two different behaviors to one tag.
am an asshole. Get used to it.
Reply
#6
Thanks, guys. I'll give it a shot when I have time.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#7
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)