效果
CSS部分
.box {
/* box-sizing: border-box; */
width: 110px;
height: 52px;
line-height: 50px;
overflow: hidden;
}
.box1 {
width: 100px;
height: 52px;
line-height: 50px;
}
ul {
margin: 0;
padding: 0;
}
li {
list-style: none;
width: 100px;
height: 50px;
text-align: center;
border: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
li:nth-child(n + 2):hover {
background-color: pink;
}
全部代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name=&