CSS .cur 游标格式

CSS .cur cursor format

我设置了自定义光标 url(mouse2.cur) 并且它没有改变。

(mouse2.png) 完美运行!有什么问题吗?

body{
    cursor: url(mouse2.cur),pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

不同的浏览器对url个光标的支持不同。

Firefox/Mac, Safari/Mac, Chrome/Mac don't support PNG and JPG cursors (tested with 48px cursors). IE only supports cursors in the CUR format.

According to CanIUse: http://caniuse.com/#search=cursor

W3C CSS3 规范状态:

The UA must support the following image file formats:

  • PNG, as defined in [PNG]
  • SVG, as defined in [SVG], in secure static mode [SVG-INTEGRATION]
  • any other non-animated image file format that they support for in other properties, such as the the background-image property

顺便说一下,W3C CSS3 规范说 .cur 游标应该被大多数浏览器支持。

Note: At the time of writing this specification (spring 2015), the only file formats supported for cursors in common desktop browsers are the .ico and .cur file formats, as designed by Microsoft. For compatibility with legacy content, UAs are encouraged to support these, even though the lack of an open specification makes it impossible to have a normative requirement about these formats. Some information on these formats can be found on Wikipedia.

http://www.w3.org/TR/css3-ui/#cursor

最后,您的 .cur 文件可能已损坏甚至 link 到 returns 404 错误。请检查 link 到您的 .cur 文件。