华为综合案例(缩放,旋转,位移,遮罩层等相关分析)

<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
a {
text-decoration: none;
}
.box {
position: relative;
display: block;
width: 350px;
height: 247px;
margin: 100px;
overflow: hidden;
}
.box h5 {
font-weight: normal;
}
.box .text {
position: absolute;
left: 0;
bottom: -40px;
padding: 0 20px;
color: #fff;
z-index: 99;
transition: .6s;
}
.box .text h4 {
margin-bottom: 30px;
}
.box::after {
content: "";
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: linear-gradient(transparent, rgba(0, 0, 0, 0.541));
opacity: 0;
transition: .6s;
}
.box img {
transition: .6s;
}
.box:hover img {
transform: scale(1.1);
}
.box:hover::after {
opacity: 1;
}
.box:hover .text {
bottom: 30px;
}
.box .close {
position: absolute;
right: 10px;
top: 10px;
transition: 1s;
font-size: 40px;
line-height: 14px;
height: 25px;
color: #000;
font-weight: 700;
}
.box:hover .close {
transform: rotate(360deg);
}
</style>
</head>
<body>
<a href="#" class="box">
<img src="./images/pic2.png" alt="">
<div class="text">
<h5>产品</h5>
<h4>OceanStor Pacific海量存储斩获2021 Interop金奖</h4>
<p>了解更多</p>
</div>
<span class="close">×</span>
</a>
</body>
</html>