views:

218

answers:

5

In FF3 I see a hand when the mouse is over the element, but in IE6 I don't. Why ? Is there any workaround ?

Example

A: 

IE6 doesn't support ":hover" selectors on anything else than <a> elements

Philippe Leybaert
+2  A: 

As Philippe mentioned, IE6 only supports :hover on <a> elements. You asked for a workaround, the only workarounds require javascript to be enabled:

Andy E
IE6 _does_ support cursor: pointer;
reisio
@resio: thanks for the correction, I didn't have time to test it myself earlier :-)
Andy E
A: 

Sometimes cursor: hand will work. Best to specify both, for standards-compliant browsers using:

cursor: pointer, hand;

What you can also do is copy the cursor from a Windows installation and point to it using a URL:

cursor: url(pointer.cur);

Or, even better yet, have it as a backup and insert it using IE's wacky support for conditional comments:

<!-- normal CSS -->
<style type="text/css">
.clickable {
    cursor: pointer;
}
</style>

<!--[if IE 6]>
<style type="text/css">
.clickable {
    cursor: url(pointer.cur);
}
</style>
<![endif]-->
amphetamachine
@downvoter: Why?
amphetamachine
+1  A: 

You can simply set foo { cursor: pointer; } (without :hover), or (better) use an a element as you almost certainly should anyways.

reisio
A: 

I would simply use Javascript if it's anything other than an tag. If you're using jQuery, you could do something like this:

$('#element').hover( function() {
   $(this).css('cursor', 'pointer');  
}, function() {
   $(this).css('cursor', 'inherit');
});
Jimmy