<!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>Document</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: black;
}
.box {
display: flex;
width: 1200px;
height: 200px;
list-style: none;
margin: 100px auto 0;
}
.box li {
overflow: hidden;
position: relative;
flex: 1;
transition:all .6s;
border: 2px solid transparent;
}
.box li:nth-child(-n+3) {
margin-right: 20px;
}
.box li img {
width: 100%;
height: 100%;
transition: all .5s;
}
.box li:hover {
border: 2px solid yellow;
}
.box li:hover img {
transform: scale(1.3);
}
.box li::before {
content: '';
position: absolute;
left: 0;top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .4);
opacity: 0;
transition: all .5s;
z-index: 5;
}
.box li:hover::before {
opacity: 1;
}
.box li::after {
content: '高山流水--庄周';
position: absolute;
bottom: 20px;
left: 50%;
transform: translate(-50%,0);
color: #fff;
transition: all .3s;
}
.box li:hover::after {
opacity: 0;
}
.box li .info {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
border: 1px solid yellow;
width: 80%;
height: 80%;
text-align: center;
padding-top: 35px;
color: #fff;
opacity: 0;
transition: all .8s;
cursor: pointer;
z-index: 6;
}
.box li .info h4 {
font-size: 20px;
margin-bottom: 5px;
font-weight: normal;
}
.box li .info span {
font-size: 12px;
}
.box li .info p {
margin-top: 5px;
font-size: 12px;
}
.box li:hover .info {
opacity: 1;
}
</style>
</head>
<body>
<ul class="box">
<li><img src="../img/1.jpg" alt="">
<div class="info">
<h4>高山流水--庄周</h4>
<span>辅助</span>
<p>上线时间: 2021.10.28</p>
</div>
</li>
<li>
<img src="../img/2.jpg" alt="">
<div class="info">
<h4>高山流水--庄周</h4>
<span>辅助</span>
<p>上线时间: 2021.10.28</p>
</div>
</li>
<li>
<img src="../img/3.webp" alt="">
<div class="info">
<h4>高山流水--庄周</h4>
<span>辅助</span>
<p>上线时间: 2021.10.28</p>
</div>
</li>
<li>
<img src="../img/4.webp" alt="">
<div class="info">
<h4>高山流水--庄周</h4>
<span>辅助</span>
<p>上线时间: 2021.10.28</p>
</div>
</li>
</ul>
</body>
</html>