用户在使用浏览器查看页面时,许多鼠标划上的操作可以提升用户体验度。
比如在默认的文字上显示的是光标,在可点击的链接处显示的是手型,可以说这两种使我们最为常用的显示方式。
但除了这些之外,还有许多的鼠标划上显示方式,如下如:
对应于cursor可以使用的值都在上面的表格中,这里是一段示例代码,大家可以复制感受一下。
<!DOCTYPE html>
<html>
<head>
<title>cursor</title>
<style type="text/css">
div {
width: 500px;
height: 32px;
margin: 3px auto;
padding: 2px;
border: 1px solid #eee;
background: #f0f0f0;
line-height: 32px;
}
</style>
</head>
<body>
<p>请把鼠标移动到单词上,可以看到鼠标指针发生变化:</p>
<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>