CSS 画动态圈

html-css019

CSS 画动态圈,第1张

<div class="container">

    <div class="light"></div>

</div>

<style>

    

    .container{

        border-radius: 50%

        background: #49b0fd

        width: 100px

        height: 100px

    }

    .light{

        width: 100px

        height: 100px

        box-shadow: 0 0 2px 2px rgba(0,0,0,1)

        border-radius: 50%

        transform-origin: center center

        position: relative

        animation: linear mymove 5s infinite

    }

    .light:after {

        position: absolute

        left: -5px

        top: 50%

        margin-top: -5px

        content: ""

        width: 10px

        height: 10px

        background: red

        border-radius: 20px

    }

    @keyframes mymove{

        from {transform:rotate(0deg)}

        to {transform:rotate(360deg)}

    }

</style>

老铁,看看这段,核心的样式写出来了,具体大小就由老铁自己去试着改啦。

几个注意点:1.两个容器最好一样大。2. 光点大小变了对应的 left和margin-top也要改。3.动画时间、动画缓动也可以改

5、上三角

最终效果:

CSS代码如下:

复制代码

代码如下:

#triangle-up {

width: 0

height: 0

border-left: 50px solid transparent

border-right: 50px solid transparent

border-bottom: 100px solid red

}

6、下三角

最终效果:

CSS代码如下:

复制代码

代码如下:

#triangle-down {

width: 0

height: 0

border-left: 50px solid transparent

border-right: 50px solid transparent

border-top: 100px solid red

}

7、左三角

最终效果:

CSS代码如下:

复制代码

代码如下:

#triangle-left {

width: 0

height: 0

border-top: 50px solid transparent

border-right: 100px solid red

border-bottom: 50px solid transparent

}

8、右三角

最终效果:

CSS代码如下:

复制代码

代码如下:

#triangle-right {

width: 0

height: 0

border-top: 50px solid transparent

border-left: 100px solid red

border-bottom: 50px solid transparent

}

9、左上三角

最终效果:

CSS代码如下:

复制代码

代码如下:

#triangle-topleft {

width: 0

height: 0

border-top: 100px solid red

border-right: 100px solid transparent

}

10、右上三角

最终效果:

CSS代码如下:

复制代码

代码如下:

#triangle-topright {

width: 0

height: 0

border-top: 100px solid red

border-left: 100px solid transparent

}

11、左下三角

最终效果:

CSS代码如下:

复制代码

代码如下:

#triangle-bottomleft {

width: 0

height: 0

border-bottom: 100px solid red

border-right: 100px solid transparent

}

12、右下三角

最终效果:

CSS代码如下:

复制代码

代码如下:

#triangle-bottomright {

width: 0

height: 0

border-bottom: 100px solid red

border-left: 100px solid transparent

}

13、平行四边形