Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hover pseudo class in IE 3

Status
Not open for further replies.

Dweezel

Technical User
Feb 12, 2004
428
GB
I'm trying to use the 'hover' pseudo class to make a simple css rollover and it's not working in my browser (IE6). I have images within the class 'roll' set with a border-color of pink, and the hover is meant to change that to red when rolled over. I've cut the code down to it's simplest possible form, but still no luck. Here's a chunk of the code I'm using:

img.roll {
border-color: red;
border-width: 7px;
}
img.roll:hover {
border-color: yellow;
}

I'm either doing something wrong, or there's a browser bug I don't know about. The above method is used in tutorials that I'm doing, and there is no mention of any browser incompatibility.

Any help appreciated.
 
Just checked it in Mozilla Firefox and it works fine. Clearly an IE bug.

Anyone know a work-around for this one?

 
IE only implements the hover pseudo class on address types "a". [sad]

You would have to write some javascript to get it to work with IE.

Ken
 
You can work around it though if you just place a <a href="javascript:void();"> tag around your code, give that tag a class, and then give that class a hover...

haslo@haslo.ch - www.haslo.ch​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top