鼠标样式:cursor
语法:
li{
curson: pointer;
}
属性值: 描述
default 小白、默认
pointer 小手
move 移动
text 文本
not-allowed 禁止
代码例子:建立5个盒子,给他们指定不同的属性
<style>
li{
list-style: none;
display: inline-block;
width: 100px;
height: 100px;
}
.a1{
background-color: red;
cursor: default;
}
.a2{
background-color: green;
cursor: pointer;
}
.a3{
background-color: blue;
cursor: move;
}
.a4{
background-color: rgb(204, 255, 0);
cursor: text;
}
.a5{
background-color: darkolivegreen;
cursor:not-allowed;
}
</style>
</head>
<body>
<li class="a1">小白、默认</li>
<li class="a2"> 小手</li>
<li class="a3">移动</li>
<li class="a4">文本</li>
<li class="a5">禁止</li>
</body>
运行结果:
鼠标放上去会有不同的样式,但截屏不好实现。