图片动画、图层遮罩

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;

        }

        .a1 {
            width: 500px;
            height: 250px;
            border: 1px solid black;
            margin: 50px auto;

        }

        div ul li {
            list-style: none;
            float: left;
            margin: 0 auto;
            padding: 20px;
            position: relative;
            overflow: hidden;
            /* z-index: 20; */

        }

        img {
            width: 200px;
            height: 200px;
        }

        .a2 {
            width: 200px;
            height: 200px;
            background-color: rgb(188, 103, 103);
            text-align: center;
            position: absolute;
            top: -220px;
            left: 20px;
            z-index: 10;
            
        }

        .a3 {
            width: 200px;
            height: 140px;
            background-color: rgb(188, 103, 103);
            text-align: center;
            position: absolute;
            top: -180px;
            left: 20px;
           

        }

        span {
            background-color: blue;

        }

        ul>li:hover .a2 {
            transform: translateY(240px);
            transition: 0.3s;
        }

        ul>li:hover .a3 {
            transform: translateY(200px);
            transition: 0.3s;
        }
        .a5{
             width: 200px;
            height: 200px;
             transform-origin: bottom;
            transform: rotateX(0);
        }
        ul>li:hover .a5 {

            transform: perspective(120px) rotateX(60deg);
            transition: 0.3s;
        }

        .a4 {
            font-size: 10px;
        }
    </style>
</head>

<body>
    <div class="a1">
        <ul>
            <li>
                <img src="./2.ico">
                <div class="a2">
                    <h2>Your Title</h2>
                    <p>Lorem ipsum dolor sitamet, consecteturadlpiscing elit, <br>
                        sed dousmod tempor incididunt ut <br>
                        labore etdolore magna aliqua</p>
                    <span>Learn more</span>

                </div>
            </li>
            <li>
                <img class="a5" src="./2.ico">
                <div class="a3">
                    <h2>Your Title</h2>
                    <p class="a4">Lorem ipsum dolor sitamet, consecteturadlpiscing elit, <br>
                        sed dousmod tempor incididunt ut <br>
                        labore etdolore magna aliqua</p>
                    <span>Learn more</span>
                </div>

            </li>
        </ul>
    </div>
</body>

</html>

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值