华为主页伸缩效果

<!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>

预览效果:

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

服务端相声演员

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值