通过 CSS 光标属性,您可以显示十字线或加号、指针等。您可以尝试运行以下代码来在 CSS 中实现光标属性 -

示例

<html>
   <head>
   </head>
   <body>
      <div style = cursor:auto>Auto</div>
      <div style = cursor:crosshair>Crosshair</div>
      <div style = cursor:default>Default</div>
      <div style = cursor:pointer>Pointer</div>
      <div style = cursor:move>Move</div>
      <div style = cursor:e-resize>e-resize</div>
      <div style = cursor:ne-resize>ne-resize</div>
      <div style = cursor:nw-resize>nw-resize</div>
      <div style = cursor:n-resize>n-resize</div>
      <div style = cursor:se-resize>se-resize</div>
      <div style = cursor:sw-resize>sw-resize</div>
      <div style = cursor:s-resize>s-resize</div>
      <div style = cursor:w-resize>w-resize</div>
      <div style = cursor:text>text</div>
      <div style = cursor:wait>wait</div>
      <div style = cursor:help>help</div>
   </body>
</html>

我们在上面添加了以下值 -

描述

auto光标的形状取决于它所处的上下文区域结束了。例如,文本上的“I”、链接上的“手”等。
十字线十字线或加号
默认箭头
指针一只指向的手(在 IE 4 中该值为手)。
移动“I”栏
e-resize光标指示框的边缘将向右(东)移动。
ne-resize光标指示框的边缘将向上和向右移动(北/东)。
nw-resize光标指示框的边缘将向上和向左移动(北/西)。
n-resize光标指示框的边缘要向上(向北)移动。
se-resize

光标指示框的边缘向下和向右移动(南/东)。
sw-resize

光标指示框的边缘向下和向左移动(南/西)。

s-resize

光标指示框的边缘向下移动(向南) ).

w-resize

光标指示框的边缘向左(向西)移动).

文本

I 栏。

等待

一个沙漏。

帮助

问号或气球,非常适合在帮助按钮上使用。
9bb6a7d109b3f2bf35f7e2e9bd87f98a

光标图像文件来源。

以上就是CSS 光标属性示例的详细内容,更多请关注双恒网络其它相关文章!

简简单单挺好的

联系我们 订单查询