View Full Version : :hover for a table row?

11-12-2008, 10:09 PM
Okay, so I'm trying to add a <tr> (row) rollover for my table on a database search. I've tried adding a .className:hover { background: #color; } and then applying that class to the tr element, but that didn't seem to work.

Any suggestions/helpful code snippets?

Thanks in advance,

11-12-2008, 10:15 PM
tr.classname:hover{background-color: #color}

I don't know if this works in IE, though.

11-12-2008, 10:15 PM
Can we have a link?

11-12-2008, 10:16 PM
I think that will only work in FF, have you tested in both FF and IE?

11-12-2008, 10:20 PM
You may need to use the whatever:hover file (http://www.xs4all.nl/~peterned/csshover.html) or try to download some javascript file from somewhere like Hotscripts.com in order to get this to work in IE.

11-12-2008, 10:26 PM
Can we have a link?


And thanks for the responses guys.. I'm going to test those out real quick. ;-)

11-12-2008, 10:36 PM
:hover on rows does not work in IE6. :hover only works on anchors in fact for IE6, and I think its support is still a little bit spotty in IE7.

Really I think without doing some very creative (and rather annoying) markup tricks, Javascript is really the simplist way to solve this conundrum.

Here is an example of a js script designed to enhance IEs ability to handle things like :hover.