在前端开发中,很多时候需要对页面的某些元素做鼠标样式的处理,比如button一般用pointer , 文本区一般用text......等等。
今天咱就来聊聊 这个经常用到的 cursor 属性
cursor默认值auto(默认浏览器设置的光标。也就是空白区 箭头,文本区 I字形, 超链接/按钮 手型)
cursor的所有值
值 | 光标说明 |
default | ![]() |
crosshair | ![]() |
pointer(hand)IE5只认hand | ![]() |
wait | ![]() |
help | ![]() |
no-drop | ![]() |
text | ![]() |
move | ![]() |
n-resize / s-resize |
(官方解释,n-向上(北)移动,s-向下移(南)动) |
e-resize / w-resize |
|
ne-resize / sw-resize | ![]() |
nw-resize / se-resize | ![]() |
not-allowed | ![]() |
progress | ![]() |
最后说明下cursor: url(' # ');这个值,亲自测试过只有IE下才有效,firefox chrome Opera均不支持。
上一张firefox给出的报错,url值被丢弃了。