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)

图像大小必须保留。我只是尝试使用body {cursor: url(' http://anuary.com/dev/hp/pad3/public/images/handcursor.png ');},虽然在FF/Chrome中不能用。(甚至不检查其他浏览器)

What's the reason for it not working?

它不工作的原因是什么?

2 个解决方案

#1


26

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

问题不仅在于css代码缺少第二个参数,还在于图像文件。

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

如果你只是调整大小,让它更小(我尝试了32px),它就像一个魅力。

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

编辑:我知道你现在想保持这个尺寸,但它就是不能工作。更多信息请参见https://developer.mozilla.org/en/using_url_values_for_the_the_cursor_property

更多相关文章

  1. 性能权衡 - CSS效率,CSS文件大小,HTML文件大小
  2. html文件上传到vss上面后文件大小改变
  3. 我似乎无法正确对齐这些图像
  4. css字体大小在苹果邮件中比gmail (iphone)要小
  5. 如何使用CSS精灵重复背景图像?
  6. 使用img src加载图像会在Mozilla / Chrome中产生不同的大小
  7. PHP选择具有特定宽度的图像并构建网格
  8. 如何在应用程序中嵌入图像并在HTML控件中使用它们?
  9. thinkphp关闭调试模式后URL大小写问题

随机推荐

  1. 「Android Tips」解决 Mac OSX 无法识别
  2. Android系统信息获取 之十:移动网络相关信
  3. Android 使用grade实现Android 项目debug
  4. Android Geocoder(位置解析)
  5. Android Studio 使用小结
  6. android 线性布局几个属性
  7. Android 3D 编程:索引
  8. zbar android sdk源码编译
  9. 如何调试跟踪Android源代码
  10. android字体大小的设置