CSS3太极的实现

77 阅读1分钟
<meta charset="UTF-8">

<title>2-5</title>

<style type="text/css">

    div {

        position: absolute;

        top: 0;

        right: 0;

        bottom: 0;

        left: 0;

        box-sizing: border-box;

        width: 400px;

        height: 400px;

        margin: auto;

        border: 1px solid red;

        border-bottom: 200px solid red;

        border-radius: 50%;

        transform-origin: 50% 50%;

        animation-name: rotate;

        animation-duration: 5s;

        animation-timing-function: linear;

        /*此处写代码*/

    }

    div::before{
        width: 20px;
        height: 20px;
        background: #fff;
        position: absolute;

        content: "";

        /*display: block;*/

        border: 90px solid red;

        border-radius: 50%;

        left: 0px;

        top: 115px;

    }



    div::after{
        width: 20px;
        height: 20px;
        position: absolute;
        background: red;
        content: "";

        /*display: block;*/

        border: 90px solid white;

        border-radius: 50%;

        right: 1px;

        top: 85px;

    }

</style>
<div></div>