css 实现一个loading旋转,减少img请求,变相提升网络加载速度

4,106 阅读1分钟
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
      .loading{
        width: 100px;
        height: 100px;
        border:10px solid #333333;
        border-bottom: #cccccc 10px solid;
        border-radius: 50%;
        -webkit-animation:load 1.1s infinite linear;
      }
      @-webkit-keyframes load{
        from{
          transform: rotate(0deg);
        }
        to{
          transform: rotate(360deg);
        }
      }
    </style>
</head>
<body>
    <div class="loading">

    </div>
</body>
</html>