一、语法
鼠标样式 cursor
li {cursor: pointer; }
设置或检索在对象上移动的鼠标指针采用何种系统预定义的光标形状。
案例:
<!DOCTYPE html>
<html lang="en">
<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>cursor鼠标形状</title>
<style>
.box1{
width: 100px;
height: 100px;
background-color: red;
/* 鼠标形状 小手 */
cursor: pointer;
}
.box2{
width: 100px;
height: 100px;
background-color: green;
/* 鼠标形状 移动 */
cursor: move;
}
.box3{
width: 100px;
height: 100px;
background-color: blue;
/* 鼠标形状 文本 */
cursor: text;
}
.box4{
width: 100px;
height: 100px;
background-color: black;
/* 鼠标形状 禁止 */
cursor: not-allowed;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box4"></div>
</body>
</html>
效果: