posts - 139,comments - 1,views - 38077

效果图:

 

代码:

复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    body{
        background: rgb(0,0,0,0.8);
    }
    #div1{
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        margin: auto;
        width: 300px;
        height: 400px;
        overflow: hidden;
        /*使伪类元素flex布局*/
        display: flex;
        /*左右居中*/
        justify-content: center;
        /*所有的子元素居中*/
        align-items: center;
        background: #000000;
        border-radius: 12px;
    }
    #div1::after{
        content: "";
        width: 500px;
        height: 500px;
        position: absolute;
        background-image: conic-gradient(transparent,transparent,transparent,#7557D1);
        animation:animate 4s infinite linear;
    }
    #div1::before {
        content: "";
        width: 500px;
        height: 500px;
        position: absolute;
        transform: rotate(180deg);
        background-image: conic-gradient(transparent, transparent, transparent, #EA4878);
        animation:animate 4s infinite linear;
        animation-delay: -2s;
    }
    #div1 span{
        position: relative;
        margin: 0 auto;
        background: #333333;
        z-index: 12;
        width: 290px;
        height: 390px;
        border-radius: 12px;
    }
    #div1 h2{
        color: #fff;
        line-height: 400px;
        text-align: center;
        font-size: 5em;
    }
    @keyframes animate {
        0%{
            transform: rotate(0deg);
        }
        100%{
            transform: rotate(360deg);
        }
    }
</style>
<body>
    <div id="div1">
        <span>
        <h2>1</h2>
        </span>
    </div>
</body>
</html>
复制代码

 

posted on   最帅爸爸  阅读(111)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示