博客列表 >css太极

css太极

廖为林的博客
廖为林的博客原创
2018年04月07日 22:22:01388浏览
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #yin-yang {
            width: 96px;
            height: 48px;
            background: #fff;
            border-color: black;
            border-style: solid;
            border-width: 2px 2px 50px 2px;
            border-radius: 100%;
            position: relative;
            animation: taiji 5s linear;
        }
        #yin-yang:hover {
            animation-play-state: paused;
        }
        #yin-yang::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 0;
            background: #fff;
            border: 18px solid black;
            border-radius: 100%;
            width: 12px;
            height: 12px;
        }
        #yin-yang::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            background: black;
            border: 18px solid #fff;
            border-radius: 100%;
            width: 12px;
            height: 12px;
        }
        @keyframes taiji {
            form{
                transform: rotate(0deg);
            }to{
                transform: rotate(360deg);
            }
        }
    </style>
</head>
<body>
    <div id="yin-yang"></div>
</body>
</html>


声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议