📜  CSS-游标

📅  最后修改于: 2020-10-26 04:48:00             🧑  作者: Mango


CSS的cursor属性允许您指定应该显示给用户的光标类型。

此属性的一种很好用法是使用图像作为表单上的提交按钮。默认情况下,当光标悬停在链接上时,光标从指针变为手。但是,它不会更改表单上的“提交”按钮的表单。因此,每当有人将鼠标悬停在作为“提交”按钮的图像上时,它都会提供视觉提示,表明该图像是可单击的。

下表显示了cursor属性的可能值-

Sr.No. Value & Description
1

auto

Shape of the cursor depends on the context area it is over. For example an I over text, a hand over a link, and so on…

2

crosshair

A crosshair or plus sign

3

default

An arrow

4

pointer

A pointing hand (in IE 4 this value is hand)

5

move

The I bar

6

e-resize

The cursor indicates that an edge of a box is to be moved right (east)

7

ne-resize

The cursor indicates that an edge of a box is to be moved up and right (north/east)

8

nw-resize

The cursor indicates that an edge of a box is to be moved up and left (north/west)

9

n-resize

The cursor indicates that an edge of a box is to be moved up (north)

10

se-resize

The cursor indicates that an edge of a box is to be moved down and right (south/east)

11

sw-resize

The cursor indicates that an edge of a box is to be moved down and left (south/west)

12

s-resize

The cursor indicates that an edge of a box is to be moved down (south)

13

w-resize

The cursor indicates that an edge of a box is to be moved left (west)

14

text

The I bar

15

wait

An hour glass

16

help

A question mark or balloon, ideal for use over help buttons

17

The source of a cursor image file

–您应该尝试仅使用这些值为用户添加有用的信息,并且在某些地方,他们希望看到该光标。例如,当有人将鼠标悬停在链接上时使用十字准线可能会使访问者感到困惑。

这是一个例子-

Move the mouse over the words to see the cursor change:

Auto
Crosshair
Default
Pointer
Move
e-resize
ne-resize
nw-resize
n-resize
se-resize
sw-resize
s-resize
w-resize
text
wait
help

它将产生以下结果-