简体   繁体   English

IMAGE 标记中的样式属性不适用于所有浏览器

[英]Style attribute in IMAGE tag is not working in all browsers

I have a style attribute that is not working.我有一个不起作用的样式属性。 In my code I am using an image for print.在我的代码中,我使用图像进行打印。 I want HAND CURSOR, so I added style attribute like the code below:我想要 HAND CURSOR,所以我添加了如下代码的样式属性:

<img id="btnPrint" alt="Print" imagealign="AbsBottom" onclick="winPrint()" src="../../Images/print.gif" style="cursor: hand" />  

but this is not working in browsers other than Internet Explorer.但这不适用于 Internet Explorer 以外的浏览器。

On Quirksmode there is compatibility table which shows hand isn't indeed supported.Quirksmode上有一个兼容性表,显示确实不支持手。 Use cursor: pointer instead of hand (because you really don't care about IE <5.5), as it is explained in the bottom of the page:使用cursor: pointer而不是hand (因为你真的不关心 IE <5.5),如页面底部所述:

In the past the hand value was Microsoft's way of saying pointer;过去,手的价值是微软表示指针的方式; and IE 5.0 and 5.5 only support hand.而 IE 5.0 和 5.5 只支持手。 Because it's the cursor value that's used most often, most other browsers have also implemented hand.因为最常用的是 cursor 值,所以大多数其他浏览器也实现了手动。

Since IE 6 and 7 support pointer, there's no more reason to use hand, except when older IEs are part of your target audience.由于 IE 6 和 7 支持指针,没有更多理由使用手,除非旧版 IE 是您的目标受众的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM