CSS自定义光标不工作在FF / Chrome [英] CSS custom cursor doesn't work in FF/Chrome

查看:104
本文介绍了CSS自定义光标不工作在FF / Chrome的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用以下图片创建自定义光标:

  http://anuary.com/dev/ hp / pad3 / public / images / hand-cursor.png 

图片大小必须保留。我试着简单地使用 body {cursor:url('http://anuary.com/dev/hp/pad3/public/images/hand-cursor.png'); } ,但在FF / Chrome中不起作用。 (甚至不检查其他浏览器)



它不能工作的原因是什么?

解决方案<



如果你只是调整大小,使它更小(我试了32像素



您可能还需要指针而不是自动,根据图像的外观判断;

  cursor:url('http://anuary.com/dev/hp/pad3/public/images/hand-cursor.png'),指针; 

EDIT
i现在想要保持尺寸但它只是不会工作。有关详情,请参见 https://developer.mozilla.org/en/Using_URL_values_for_the_cursor_property 了解详情


I am trying to create a custom cursor using the following image:

http://anuary.com/dev/hp/pad3/public/images/hand-cursor.png

The image size must be retained. I've tried simply to use body { cursor: url('http://anuary.com/dev/hp/pad3/public/images/hand-cursor.png'); }, though that doesn't work in FF/Chrome. (not even checking other browsers)

What's the reason for it not working?

解决方案

The problem is not just with your css code lacking second argument but with the image file.

If you simply resize, make it smaller (i tried 32px for testing purposes) it works like a charm.

You might also want "pointer" rather than auto, judging by the look of the image;

cursor: url('http://anuary.com/dev/hp/pad3/public/images/hand-cursor.png'), pointer;

EDIT: i realize now you wanted to keep the size but it just won't work. see https://developer.mozilla.org/en/Using_URL_values_for_the_cursor_property for more info

这篇关于CSS自定义光标不工作在FF / Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆