html跳动的心实现代码

Posted zhuxinpeng-looking

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html跳动的心实现代码相关的知识,希望对你有一定的参考价值。

<style>
        .box{
            width: 200px;
            height: 400px;
            position: relative;
            margin: 30px auto;
            transform: all 0.5s;

        }
        @keyframes moves{
            from{box-shadow: 0 0 0 transparent;}
            30%{box-shadow: 0 0 50px rgb(236, 57, 57);}
            60%{box-shadow: 0 0 80px rgb(241, 97, 97);}
        }
        .box>div{
            animation: moves 1s infinite;
            transition-delay: 1s;
        }
        .box_1{
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background: red;
            border-bottom: 0;

        }
        div:nth-child(2){
            position: absolute;
            top: 0;
            left:80px;
        }
        .box_2{
            width: 100px;
            height: 130px;
            background: red;
            transform: rotateZ(57deg);
           
        }
        .box>div:nth-child(3){
            position: absolute;
            top: 2px;
            right: 31px;
            background-color: red;
            border-radius: 50% 50% 0% 0;
            box-shadow: 0 0 0 transparent !important;
        }
        .box>div:last-child{
            position: absolute;
            top: 4px;
            left: 12px;
            transform: rotateZ(122deg);
            border-radius: 0 0% 50% 50%;
        }
        /* .box:hover>div{
            box-shadow: 0 0 10px rgb(241, 97, 97);
        } */
    </style>
</head>
<body>
    <div class="box">
        <div class="box_1"></div>
        <div class="box_1"></div>
        <div class="box_2"></div>
        <div class="box_2"></div>
    </div>
</body>
</html>

以上是关于html跳动的心实现代码的主要内容,如果未能解决你的问题,请参考以下文章

七夕来袭,是时候展现专属于程序员的浪漫了- 跳动的心和摇晃的红酒杯

html 跳动的心

html 跳动的心

用css3做出简单动画:跳动的心

跳动的心

跳动的心 有阴影 跳动