CSS(四)——三个盒子的动画效果

三个盒子的动画效果

<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></title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            width: auto;
            background-color: #333;
        }
        
        .box {
            width: auto;
            height: 100vh;
            background-color: #333;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        .one {
            /* position: relative; */
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
            width: 280px;
            /* height: 100vh; */
            background-color: #333;
            margin: 20px;
        }
        
        .one .oone {
            position: relative;
            transform: translateY(100px);
            transition: transform 0.65s, background-color 0.65s;
            text-align: center;
            line-height: 200px;
            text-shadow: 2px 1px rgb(92, 97, 119);
            /* box-shadow: 0px rgb(0, 0, 0.5); */
            width: 190px;
            height: 200px;
            border: 1px solid rgb(71, 64, 64);
            background-color: #333;
            z-index: 1;
            font-size: 36px;
            color: rgb(105, 110, 126);
        }
        
        .one .otwo {
            position: relative;
            transform: translateY(-100px);
            transition: transform 0.5s;
            /* left: 20px; */
            width: 190px;
            height: 200px;
            background-color: rgb(120, 100, 175);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
        }
        
        .one:hover .oone {
            transform: translateY(0);
            opacity: 0.95;
            text-shadow: 0 0;
            font-size: 30px;
            color: rgb(214, 208, 185);
            background-color: rgb(80, 81, 139);
            box-shadow: 0;
        }
        
        .one:hover .otwo {
            transform: translateY(0);
        }
        
        .text {
            position: absolute;
            left: 10px;
            top: 50px;
            color: rgb(207, 202, 180);
        }
        
        .lianjie {
            position: absolute;
            display: inline-block;
            transition: color 0.3s, border 0.3s;
            left: 20px;
            bottom: 50px;
            border: 2px solid rgb(207, 161, 44);
            border-radius: 5px;
            width: auto;
            height: auto;
            text-align: center;
        }
        
        .lianjie:hover {
            background-color: rgb(89, 47, 122);
            border: 2px solid rgb(89, 47, 122);
            z-index: 1;
        }
        
        .zi {
            text-decoration: none;
            font-size: 18px;
            color: rgb(207, 161, 44);
        }
        /* .one .otwo::before {
            content: ""; */
        /* display: none; */
        /* background-color: rgb(177, 62, 27, );
        } */
        /* .one .otwo:hover::before {
            display: block;
        } */
    </style>
</head>

<body>
    <div class="box">
        <div class="one">
            <div class="oone">one</div>
            <div class="otwo">
                <div class="text">This is one</div>
                <div class="lianjie">
                    <a href="#" class="zi" target="black">one</a>
                </div>
            </div>
        </div>
        <div class="one">
            <div class="oone">two</div>
            <div class="otwo">
                <div class="text">This is two</div>
                <div class="lianjie">
                    <a href="#" class="zi" target="black">two</a>
                </div>
            </div>
        </div>
        <div class="one">
            <div class="oone">three</div>
            <div class="otwo">
                <div class="text">This is three</div>
                <div class="lianjie">
                    <a href="https://www.bilibili.com/" target=class="zi" target="black">three</a>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值