CSS如何设置鼠标样式?下面本篇文章就来给大家介绍一下使用CSS设置鼠标样式的方法。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。
在CSS中,可以使用cursor
属性来设置鼠标样式。cursor
属性规定要显示的鼠标(光标)的类型(形状)。
cursor
属性定义了鼠标指针放在一个元素边界范围内时所用的光标形状(不过 CSS2.1 没有定义由哪个边界确定这个范围)。
可能的值:
<table class=\"datAIntable\”>
需使用的自定义光标的 URL。
注释:请在此列表的末端始终定义一种普通的光标,以防没有由 URL 定义的可用光标。
示例1:
.custom { cursor: url(https://img.php.cn/upload/article/000/000/006/5d89c525da790357.png),pointer; }
示例2:
.auto { cursor: auto; } .default { cursor: default; } .none { cursor: none; }
示例3:
.context-menu { cursor: context-menu; } .help { cursor: help; } .pointer { cursor: pointer; } .progress { cursor: progress; } .wait { cursor: wait; }
示例4:
.cell { cursor: cell; } .crosshair { cursor: crosshair; } .text { cursor: text; } .vertical-text { cursor: vertical-text; }
示例5:
.alias { cursor: alias; } .copy { cursor: copy; } .move { cursor: move; } .no-drop { cursor: no-drop; } .not-allowed { cursor: not-allowed; }
示例6:
.zoom-in { cursor: -webkit-zoom-in; cursor: zoom-in; } .zoom-out { cursor: -webkit-zoom-out; cursor: zoom-out; }
示例7:
.grab { cursor: -webkit-grab; cursor: grab; } .grabbing { cursor: -webkit-grabbing; cursor: grabbing; }
示例8:
.n-resize { cursor: n-resize; } .ne-resize { cursor: ne-resize; } .e-resize { cursor: e-resize; } .se-resize { cursor: se-resize; } .s-resize { cursor: s-resize; } .sw-resize { cursor: sw-resize; } .w-resize { cursor: w-resize; } .nw-resize { cursor: nw-resize; } .se-resize { cursor: se-resize; } .ew-resize { cursor: ew-resize; } .ns-resize { cursor: ns-resize; } .nesw-resize { cursor: nesw-resize; } .nwse-resize { cursor: nwse-resize; } .col-resize { cursor: col-resize; } .row-resize { cursor: row-resize; } .all-scroll { cursor: all-scroll; }
© 版权声明
THE END
暂无评论内容