zoukankan      html  css  js  c++  java
  • css3旋转动画

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>CSS 加载动画</title>
    
    <style>
    body {
      background-color: #fff;
    }
    #demo {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    #loading {
        display: block;
        position: relative;
        left: 50%;
        top: 50%;
        width: 200px;
        height: 200px;
        margin: -90px 0 0 -90px;
        border-radius: 50%;
        border: 3px solid transparent;
        border-top-color: red;
        -webkit-animation: spin 2s linear infinite;
        animation: spin 2s linear infinite;
    }
    #loading:before {
        content: "";
        position: absolute;
        top: 5px;
        left: 5px;
        right: 5px;
        bottom: 5px;
        border-radius: 50%;
        border: 3px solid transparent;
        border-top-color: #000;
        -webkit-animation: spin 3s linear infinite;
        animation: spin 3s linear infinite;
    }
    #loading:after {
        content: "";
        position: absolute;
        top: 20px;
        left: 20px;
        right: 20px;
        bottom: 20px;
        border-radius: 50%;
        border: 3px solid transparent;
        border-top-color: #FF00FF;
        -webkit-animation: spin 1.5s linear infinite;
        animation: spin 1.5s linear infinite;
    }
    @-webkit-keyframes spin {
        0%   {
            -webkit-transform: rotate(0deg);
            -ms-transform: rotate(0deg);
            transform: rotate(0deg);
        }
        100% {
            -webkit-transform: rotate(360deg);
            -ms-transform: rotate(360deg);
            transform: rotate(360deg);
        }
    }
    @keyframes spin {
        0%   {
            -webkit-transform: rotate(0deg);
            -ms-transform: rotate(0deg);
            transform: rotate(0deg);
        }
        100% {
            -webkit-transform: rotate(360deg);
            -ms-transform: rotate(360deg);
            transform: rotate(360deg);
        }
    }
    </style>
    
    </head>
    <body>
    
    <div id="demo">
      <div id="loading"></div>
    </div>
    
    </body>
    </html>

    效果图:

  • 相关阅读:
    SSH的密钥登录配置
    VMware 15pro虚拟机网络设置
    12种SQL注入报错方式
    PHP myadmin 无路径getshell
    MySQL数据库基本操作
    ubuntu 16.04安装后的简单优化
    无聊中,静思自己。
    Silverlight 4.0+Linq to sql 网站后台登陆功能(一)
    AspNetPager和Linq to sql 的完美结合
    Linq to sql 的DataContext 持久化层写法
  • 原文地址:https://www.cnblogs.com/huanghuali/p/9143841.html
Copyright © 2011-2022 走看看