純css3實現旋轉的太極圖

效果圖
 
上代碼:
------------------------------------------------------------
<body>
    <div class="div"></div>
    <style>
        body {
            background-color: #aaa;
        }

        .div {
            width: 400px;
            height: 400px;
            border-radius: 50%;
            border: 1px solid #ddd;
            background-image:
                radial-gradient(50% 50% at 50% 25%, #000 10%, transparent 0),
                radial-gradient(50% 50% at 50% 75%, #fff 10%, transparent 0),
                radial-gradient(50% 50% at 50% 25%, #fff 50%, transparent 0), radial-gradient(50% 50% at 50% 75%, #000 50%, transparent 0),
                linear-gradient(to left, #fff 50%, #000 50%);
            animation: rotate 3s linear infinite;
        }

        @keyframes rotate {
            from {
                transform: rotate(0deg)
            }

            to {
                transform: rotate(359deg)
            }
        }
    </style>
</body>
剛剛開始在博客園寫正式文章,不少東西正在摸索,樣式問題後面再慢慢修改,0.0
相關文章
相關標籤/搜索