设置光标在元素上显示的样式,属性名:cursor
常见属性值:
1、default 通常是小箭头,默认值
2、pointer 小手标志,提示用户此处可以点击
3、text 工字形状,提示用户可以选择文字
4、move 十字光标,提示用户可以移动图片等
练习代码如下:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
li {
background-color: red;
height: 30px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<ul>
<li style="cursor:default">default 箭头 (默认样式)</li>
<li style="cursor:pointer">poiner 小手</li>
<li style="cursor:move">move 移动</li>
<li style="cursor:text">text 文本光标</li>
<li style="cursor:not-allowed">not-allowed 禁止</li>
</ul>
</body>
</html>