Javascript CSS2 光标不显示“手”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4343349/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 11:59:32  来源:igfitidea点击:

CSS2 cursor not displaying "hand"

javascripthtmlcsscursor

提问by Tam N.

I'm following the standard of W3C here http://www.w3.org/TR/CSS2/ui.htmland here http://www.quirksmode.org/css/cursor.html#note. However, the element isn't displayed the hand when mouseover. Please help.

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

<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>

When viewing with IE9 and mouseover, it doesn't change the cursor into the "hand", but it's just the regular arrow instead. Please advise.

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

Thanks!

谢谢!

回答by BoltClock

It should be cursor: pointer;alone because handis a proprietary value only implemented by old versions of IE, and is thus an invalid value.

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

If you actually care about IE 5.x, though, you switch the two properties around, i.e. (cursor: hand; cursor: pointer, hand comes first). Your CSS will still invalidate though, so I'd rather you not bother.

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

回答by red-X

in your supplied link:

在您提供的链接中:

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

handis not valid css

hand不是有效的 css

in the other link hand is mentioned however it is only supported in ie, excluding ie9 beta, and in opera.

在另一方面提到了链接,但是它仅在 ie 中受支持,不包括 ie9 beta,并且在 opera 中。

if you are looking for the hand with the pointing indexfinger you want pointerto be the last one mentioned in the css

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

回答by Alex Gyoshev

handis not a valid value for cursor -- it is IE8- legacy. Use pointer.

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

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

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

回答by Kristof Claes

Try leaving out "cursor:hand;". According to the article you refer to, it is only needed for Internet Explorer 5. Unless you are developing a internal web app for a company who still work with that browser, I'd leave it out.

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