我试图在我的<body>
标记上创建自定义光标图像。它不起作用,Mozilla显示无效的属性值。但我不能修复这个请我的CSS:css显示无效属性值的自定义光标
body {
height : 100%;
box-sizing : border-box;
background : transparent;
margin : 0;
padding : 0;
cursor: url(icons/cursoricon.png), auto;
}
谢谢!
我试图在我的<body>
标记上创建自定义光标图像。它不起作用,Mozilla显示无效的属性值。但我不能修复这个请我的CSS:css显示无效属性值的自定义光标
body {
height : 100%;
box-sizing : border-box;
background : transparent;
margin : 0;
padding : 0;
cursor: url(icons/cursoricon.png), auto;
}
谢谢!
你见过this question and answer?根据the Mozilla guide,似乎更改为以下代码可能会解决您的问题。
cursor: url(icons/cursoricon.png) 2 2, auto;
*其中2是可选的X和Y坐标。不知道为什么它解决了这个人的问题,因为它似乎参数是可选的,但值得尝试。
你好我检查这一点,也尝试但不工作检查此图像[链接](http://imgur.com/a/7HHxO) – Hobo
你能尝试在其他浏览器如Chrome,看看会发生什么?如果这不起作用,您能否澄清您的URL是否正确添加?查阅本指南并尝试与URL替换当前的URL(https://images.vexels.com/media/users/3/131776/isolated/lists/f23a086a9cb2698654d0bc143ec2f83b-pixilated-hourglass-mouse-cursor.png)或任何其他在线图片,看看你的路径是否正确。也许网址(./图标/ cursoricon.png)? https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property –
感谢您的建议,但它仍然没有工作。它的工作对[W3C(https://www.w3schools.com/cssref/playit.asp?filename=playcss_cursor&preval=url(smiley.gif),网址(myBall.cur),自动),但如何? – Hobo
它工作吗?参见[W3Schools的(https://www.w3schools.com/cssref/playit.asp?filename=playcss_cursor&preval=url(smiley.gif),网址(myBall.cur),自动)具有相同的 “问题”。 –
这里它工作我检查了它。 – Hobo
尝试将您的第二个参数从自动更改为指针,并尝试调整图像大小。我认为光标的最大大小应该是32x32px左右 – JavaEvgen