如何使用 html 或 javascript 将光标样式设为圆形
How to make cursor style to circle using html or javascript
我正在构建一个绘图应用程序,我想要一个圆圈形式的光标。我搜索了 HTML5 样式来使光标默认、指针等,但我需要它是一个圆圈。我该怎么做?
你可以使用图像作为光标,通过使用这个 css 属性
cursor: url(images/my-cursor.png), auto;
例如,如果你有一些输入并且你想在上面显示圆形光标,你应该使用 png 图像
input{
cursor: url(images/my-cursor.png), auto;
}
检查这个 jsfiddle
http://jsfiddle.net/pwy51Ly8/
可以使用CSS游标等待
div {
cursor: wait;
}
或
div {
cursor: url("your custom cursor image"), auto;
}
来自 this link
"It wasn't working because your image was too big - there are restrictions on the image dimensions. In Firefox, for example, the size limit is 128x128px"
你想做的,CSS都能做到。
查看以下代码段和此 jsfiddle
#circle64 {
cursor: url('http://www.iconsdownload.net/icons/64/16574-black-circle.png'), pointer;
}
#circle32 {
cursor: url('http://www.iconsdownload.net/icons/32/16574-black-circle.png'), pointer;
}
#circle24 {
cursor: url('http://www.iconsdownload.net/icons/24/16574-black-circle.png'), pointer;
}
<div id='circle64'>
Cursor will
<br>be</br>different here.
</div>
<br>
<br>
<br>
<div id='circle32'>
Cursor will
<br>be</br>different here.
</div>
<br>
<br>
<br>
<div id='circle24'>
Cursor will
<br>be</br>different here.
</div>
我正在构建一个绘图应用程序,我想要一个圆圈形式的光标。我搜索了 HTML5 样式来使光标默认、指针等,但我需要它是一个圆圈。我该怎么做?
你可以使用图像作为光标,通过使用这个 css 属性
cursor: url(images/my-cursor.png), auto;
例如,如果你有一些输入并且你想在上面显示圆形光标,你应该使用 png 图像
input{
cursor: url(images/my-cursor.png), auto;
}
检查这个 jsfiddle http://jsfiddle.net/pwy51Ly8/
可以使用CSS游标等待
div {
cursor: wait;
}
或
div {
cursor: url("your custom cursor image"), auto;
}
来自 this link "It wasn't working because your image was too big - there are restrictions on the image dimensions. In Firefox, for example, the size limit is 128x128px"
你想做的,CSS都能做到。
查看以下代码段和此 jsfiddle
#circle64 {
cursor: url('http://www.iconsdownload.net/icons/64/16574-black-circle.png'), pointer;
}
#circle32 {
cursor: url('http://www.iconsdownload.net/icons/32/16574-black-circle.png'), pointer;
}
#circle24 {
cursor: url('http://www.iconsdownload.net/icons/24/16574-black-circle.png'), pointer;
}
<div id='circle64'>
Cursor will
<br>be</br>different here.
</div>
<br>
<br>
<br>
<div id='circle32'>
Cursor will
<br>be</br>different here.
</div>
<br>
<br>
<br>
<div id='circle24'>
Cursor will
<br>be</br>different here.
</div>