CSS 动画:纯 CSS 实现 loading 效果

效果 

 

代码 

<!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>
</head>
<style>
  /* CSS */
  .simple-spinner {
    height: 48px;
    width: 48px;
    border: 5px solid rgba(150, 150, 150, 0.2);
    border-radius: 50%;
    border-top-color: rgb(150, 150, 150);
    animation: rotate 1s 0s infinite linear normal;
  }

  @keyframes rotate {
    0% {
      transform: rotate(0);
    }

    100% {
      transform: rotate(360deg);
    }
  }
</style>

<body>
  <div class="simple-spinner"></div>
</body>
<script>

</script>

</html>
发布了171 篇原创文章 · 获赞 499 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/qq_43258252/article/details/103362073