CSS改变鼠标指针形状的方法:
在项目中会遇到需要点击的图片,字体,按钮等,就需要鼠标的指针形式变成小手型;
当文本款,文本域是禁止输入的时候,鼠标的指针变成红圈中间一道杠的形式;
首先看一下cursor的属性表:
- 默认 default
- 文字/编辑 text
- 自动 auto
- 手形 pointer, hand(hand是IE专有)
- 可移动对象 move
- 不允许 not-allowed
- 无法释放 no-drop
- 等待/沙漏 wait
- 帮助 help
- 十字准星 crosshair
- 向上改变大小(North) n-resize
- 向下改变大小(South) s_resize 与n-resize效果相同
- 向左改变大小(West) w-resize
- 向右改变大小(East) e-resize 与w-resize效果相同
- 向左上改变大小(NorthWest) nw-resize
- 向左下改变大小(SouthWest) sw-resize
- 向右上改变大小(NorthEast) ne-resize 与sw-resize效果相同
- 向右下改变大小(SouthEast) se-resize 与nw-resize效果相同
- 自定义光标 url(‘光标地址’)