Forum Moderators: not2easy

Message Too Old, No Replies

TD tags and on hover backgrounds

Again, sorry guys :-)

         

esuna

9:49 am on Aug 22, 2003 (gmt 0)



Hey everyone, first off, i'm new, so be kind.

I've been playing around with CSS trying to do hover backgrounds for table cells, done that, but now the problem. I also wish for another cell to change colour at the same time as the main cell (with the link in it).

I can't for the life of me figure out how to do this and it's becoming an annoyance. :-\

MonkeeSage

9:58 am on Aug 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Unless the one you want to change colors is nested inside the one that is being hovered, it is not possible, I don't think, but you may have some luck with the immediate child (or 'adjacent sibling' selector (+), e.g.,

#td1:hover + tr td { background: orange; }

See here [w3.org] for a complete list of all the selectors w/ examples.

I've never figured it out though, if it is possible. For stuff like that I just end up using onmouseover event handlers on the elements to call a JS function that will do the hiliting of the other elements.

Jordan