I have an unordered list that contains inline images. I’m attaching a “click” handler to these images via jQuery.
However, the default cursor in this case is a pointer. How can I enable a hand cursor when the mouse pointer is over an img in this list?
This does not work…
.myList li {cursor:hand !important}
<ul class=“myList”>
<li><img src=“foo.png” alt=“foo” /></li>
<li><img src=“bar.png” alt=“bar” /></li>
</ul>
“Hand” is an outdated IE only property – for MODERN browsers you want to add cursor:pointer; BEFORE cursor:hand – you need both so that old versions of IE work… and you need to put the invalid one SECOND as it confuses things the other way around.
.myList li {
cursor:pointer;
cursor:hand;
}
As Jason said hand is an old IE only property and only needed if you are supporting ie5.x. Ie6+ will be fine with pointer.
Thanks to you both for the help. I had a brain cramp on that one. The problem was actually a syntax error in my jQuery.