我正在使用 css 自定义光标为光标使用图像。图像不起作用。这段代码有什么问题?
Here是使用的图像。 Fiddle
cursor: url('http://www.sarkelliancreed.comule.com/pics/TREES.jpg'), auto;
最佳答案
昨晚我正在处理这个问题。问题是可以用作光标的图像大小有限制。如果你真的需要一个大的图像来跟随光标,让一个带有该图像的 div 捕捉到 mousemove 事件中的光标位置。
MDN 至少描述了 Firefox 的大小限制:
In Gecko (Firefox) the limit of the cursor size is 128×128px. Larger cursor images are ignored. However, you should limit yourself to the size 32×32 for maximum compatibility with operating systems and platforms.
MDN documentation for cursor property in CSS
输入这个笑脸而不是你正在使用的图像作为 URL 并再次运行 Fiddle,它工作了:http://icons-search.com/img/icons-land/IconsLandVistaStyleEmoticonsDemo.zip/IconsLandVistaStyleEmoticonsDemo-ICO-Cool.ico-32x32.png
关于html - css 自定义光标不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30309156/