欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

css实现loading动画

程序员文章站 2022-03-18 20:12:52
...

css实现loading动画 

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>loading</title>
</head>
<style>

    .loading__anim {  
        width: 35px;
        height: 35px;
        display: inline-block;
        border: 5px solid rgba(189,189,189 ,0.25);
        border-left-color: rgba(3,155,229 ,1);
        border-top-color: rgba(3,155,229 ,1);
        border-radius: 50%;
        animation: rotate 600ms infinite linear;
    }

    @keyframes rotate {
        to {  transform: rotate(1turn) }
    }
    
</style>
<body>
    <div style="position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);">
        <div class="loading__anim"></div>
    </div>
   
</body>
</html>

相关标签: css 动画 html