3 replies [Last post]
meldra
Offline
newbie
Last seen: 17 years 41 weeks ago
Timezone: GMT+10
Joined: 2004-12-19
Posts: 3
Points: 0

I am using a div class as a link. On hover the image is supposed to swap via CSS.

HTML:

    <a href="#"><div class="navbutton">Link 1</div></a>

CSS:

.navbutton {
	text-align: right;
	width: 150px;
	height: 30px;
	background: url(images/buttonlight.gif) no-repeat;
	cursor: hand;
	padding-top: 5px;
	padding-right: 3px;
}

.navbutton:hover {
	width: 150px;
	height: 30px;
	background: url(images/buttondark.gif) no-repeat;
	cursor: hand;
}

In FireFox and Opera, this works PERFECTLY. However, our *cough*stupid*cough* old friend Internet Explorer is not so kind.

First issue: IE does not display the link (hand) cursor unless you use "cursor: hand;"

Second issue: IE does not do the image swap. This I have not yet figured out a way to overcome yet.

Does anyone know?

-Mel

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 22 weeks 4 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

using divs as links

Sigh.

To cut a long story short, IE doesn't support the :hover attribute on anything other than links (a).

Verschwindende wrote:
  • CSS doesn't make pies

meldra
Offline
newbie
Last seen: 17 years 41 weeks ago
Timezone: GMT+10
Joined: 2004-12-19
Posts: 3
Points: 0

using divs as links

I just reached a new level of peeved-off-ness with IE. It's so freaking slack.

I pray that the next version of IE will have some form of intelligence...

meldra
Offline
newbie
Last seen: 17 years 41 weeks ago
Timezone: GMT+10
Joined: 2004-12-19
Posts: 3
Points: 0

using divs as links