10

我在http://www.w3.org/TR/CSS2/ui.htmlhttp://www.quirksmode.org/css/cursor.html#note遵循 W3C 的标准。但是,当鼠标悬停时,元素不会显示手。请帮忙。

<a style="cursor:pointer;cursor:hand" onclick='javascript:window.open("http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>&amp;t=<?php single_post_title(); ?>", "_blank", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,left=300,top=100,width=626,height=436")'>[image goes here]</a>

用 IE9 和鼠标悬停查看时,它不会将光标变为“手”,而只是常规箭头。请指教。

谢谢!

4

4 回答 4

30

它应该是cursor: pointer;单独的,因为它hand是仅由旧版本的 IE 实现的专有值,因此是无效值。

但是,如果您真的关心 IE 5.x,您可以切换这两个属性,即 ( cursor: hand; cursor: pointer, hand come first)。你的 CSS 仍然会失效,所以我宁愿你不要打扰。

于 2010-12-03T07:31:38.460 回答
3

在您提供的链接中:

Value:      [ [<uri> ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress ] ] | inherit

hand不是有效的 CSS

在另一个链接中提到了它,但它仅在 ie 中受支持,不包括 ie9 beta 和在 opera 中。

如果您正在寻找带有指向食指的手,那么您想pointer成为css中提到的最后一个

于 2010-12-03T07:30:47.457 回答
3

hand不是游标的有效值——它是 IE8-legacy。使用pointer.

http://www.w3schools.com/css/pr_class_cursor.asp

于 2010-12-03T07:32:46.853 回答
2

尝试省略“光标:手;”。根据您所指的文章,仅 Internet Explorer 5 需要它。除非您正在为仍在使用该浏览器的公司开发内部 Web 应用程序,否则我会忽略它。

于 2010-12-03T07:32:18.617 回答