<!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>
* {
padding: 0;
margin: 0;
}
li {
list-style: none;
}
.w {
margin: 0 auto;
width: 1270px;
}
.header {
position: relative;
margin: 0 auto;
width: 176px;
height: 64px;
}
.header h1 {
font-size: 35px;
color: #333333;
}
.header::after {
position: absolute;
content: '';
bottom: 10px;
right: 46%;
height: 2px;
width: 50px;
background-color: #c7000b;
}
.images {
margin-top: 20px;
height: 847px;
background-color: #fff;
}
.images ul li {
position: relative;
float: left;
margin-top: 15px;
overflow: hidden;
}
.bigimgbox {
width: 825px;
height: 400px;
background-color: yellowgreen;
}
.bigimgbox img {
width: 825px;
height: 400px;
transition: all 0.5s;
}
.smallimgbox {
width: 400px;
height: 400px;
background-color: violet;
}
.smallimgbox img {
width: 400px;
height: 400px;
transition: all 0.5s;
}
.images ul li p {
position: absolute;
top: 80%;
left: 7%;
z-index: 2;
color: #ffffff;
font-size: 24px;
transition: all 0.5s;
}
.images ul li span {
position: absolute;
z-index: 2;
bottom: -10%;
left: 7%;
color: #ffffff;
transition: all 0.5s;
}
.images ul li:nth-child(2n) {
margin-left: 10px;
margin-right: 10px;
}
.images ul li:nth-child(n) {
margin-left: 15px;
}
.mask {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: linear-gradient(transparent,
rgba(0, 0, 0, 0.6));
opacity: 0;
transition: all 0.5s;
}
.images ul li:hover .mask {
opacity: 1;
}
.images ul .bigimgbox:hover p {
transform: translateY(-25px);
}
.images ul .bigimgbox:hover span {
transform: translateY(-80px);
}
.images ul .smallimgbox:hover p {
transform: translateY(-35px);
}
.images ul .smallimgbox:hover span {
transform: translateY(-85px);
}
.images ul li:hover img {
transform: scale(1.15);
}
</style>
</head>
<body>
<div class="w">
<div class="header">
<h1>推荐信息</h1>
</div>
</div>
<div class="w images">
<ul>
<li class="bigimgbox">
<img src="华为图/huawei1.jpg" alt="">
<p>HUAWEI MateBook X Pro 2022 12 代酷睿版</p>
<span>更多详情></span>
<div class="mask"></div>
</li>
<li class="smallimgbox">
<img src="华为图/huawei2.jpg" alt="">
<p>HUAWEI MateBook E Go 性能版</p>
<span>更多详情></span>
</li>
<li class="smallimgbox">
<img src="华为图/huawei3.jpg" alt="">
<p>HUAWEI nova 10 Pro</p>
<span>更多详情></span>
</li>
<li class="bigimgbox">
<img src="华为图/huawei4.jpg" alt="">
<p>HUAWEI MatePad Pro 11 英寸</p>
<span>更多详情></span>
</li>
</ul>
</div>
</body>
</html>
预览效果: