Question

I'd like to add row highlighting on hover using on CSS that will work in Internet Explorer. I have tried the following:

#tableId tr:hover td { background-color:#f00; }

This seems to work in Opera, Firefox, and Safari, but not in IE.

Is there a solution or is the only solution JavaScript?

Was it helpful?

Solution

Some versions of IE (specifically, IE6, though :hover is buggy in IE7) do not support :hover, which means there's simply no way to accomplish row highlighting without JavaScript.

Just to be technically correct - IE6 does support :hover, but only on anchor tags, so you can't target table rows.

OTHER TIPS

Daniel Lew is correct. IE6 only supports hover on anchor elements but I know from experience IE7 will support hover on what you plan on doing. To get IE6 to do the hover I used csshover.htc. I can't remember where I found it, but if you google "csshover.htc" you'll get a bunch of links (example: whatever:hover). I do know that it was free and open source so you can also just rip it off this site I made :).

EDIT: I'm a dumbass. The link I provided is the exact one I used :)

EDIT2: This is a hover working in IE7 for the exact same situation you have (doesnt implement IE6 fix however) New Truck Search Directory

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top