cheap web hosting

:hover on div and span elements

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 222 posts

Joined: Sep 1999

The W3C says that :hover is supported by IE since v4, but I can't get it working on div and span elements. For example: http://apexcommunity.donet.com. If you look @ it in FF the home icon in the header changes on hover, but in IE it doesn't. Here's the relevant CSS:

#topnav-home2
{
background-image: url(images/quicklinks/home-off.gif);
background-repeat: no-repeat;
}

#topnav-home2:hover
{
background-image: url(images/quicklinks/home-on.gif);
}

Greg K's picture
Moderator

He has: 1,638 posts

Joined: Nov 2003

Not sure if it has to do with the problems you have, but when I first started doing that, found that they had to be in a ceratin order, and I'm not sure if they all have to be there for that order to be "complete", try the following:

#topnav-home2 { ... }
#topnav-home2:link { ... }
#topnav-home2:visited { ... }
#topnav-home2:hover { ... }

Perhaps you also have to define the a. tag with the id name. It's been a while since I've had to do this, so I'm not sure how offhand. as an example, for my site where I usd this, I had thw following:

a.subTitle { ... }
a.subTitle:link { ... }
a.subTitle:visited { ... }
a.subTitle:hover { ... )

Hope this helps.

-Greg

[This space intentionally left blank]

Cool Geek Supplies: www.ThinkGeek.com

Renegade's picture
Moderator

He has: 2,944 posts

Joined: Oct 2002

They have: 222 posts

Joined: Sep 1999

Thanks Renegade, that's what the problem was. Got it working now Smiling