zoukankan      html  css  js  c++  java
  • 太阳地球月亮运行动画(使用@keyframes)

     闲来无事的demo

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4     <meta charset="utf-8">
     5     <title></title>
     6     <style type="text/css">
     7         body{
     8             background: #000;
     9         }
    10         .sun{
    11              280px;
    12             height: 280px;
    13             margin-top: 200px;
    14             margin-left: 300px;
    15             border:1px solid #FFA500;
    16             background:#FFA500;
    17             border-radius: 50%;
    18             box-shadow:0px 0px 35px #FFA500;
    19             animation:action 10s;
    20             animation-iteration-count:infinite;
    21             animation-timing-function:linear;
    22         }
    23         @keyframes action{
    24             0% { transform: rotate(0deg) }
    25             100% { transform: rotate(360deg)}
    26         }
    27         .earth{
    28             border:1px solid #0000CC;
    29             background:#0000CC;
    30             box-shadow:0px 0px 35px #0000CC;
    31              40px;
    32             height: 40px;
    33             border-radius: 50%;
    34             margin-left: -90px;
    35             animation:actions 5s;
    36             animation-iteration-count:infinite;
    37             animation-timing-function:linear;
    38         }
    39         @keyframes actions{
    40             0% { transform: rotate(0deg) }
    41             100% { transform: rotate(360deg)}
    42         }
    43         .moon{
    44             border:1px solid #F0F0F0;
    45             background:#F0F0F0;
    46             box-shadow:0px 0px 35px #F0F0F0;
    47              10px;
    48             height: 10px;
    49             border-radius: 50%;
    50             margin-left: -20px;
    51         }
    52     </style>
    53 </head>
    54 <body>
    55 
    56 <div class="sun">
    57     <div class="earth">
    58         <div class="moon"></div>
    59     </div>
    60 </div>
    61 
    62 </body>
    63 </html>
    View Code
  • 相关阅读:
    GitHub(二)之修改项目语言类型
    GitHub(一)之图片上传问题
    Git入门操作(一)
    树莓派小白教程六部曲
    关于Ajax请求的JS封装函数
    JavaScript运动_封装模板(支持链式运动、完美运动)
    NAT-地址转换技术的配置
    JAVA连接Sql-Server教程
    Kibana对数据的可视化
    浏览器渲染机制
  • 原文地址:https://www.cnblogs.com/xiaoyun1121/p/6207140.html
Copyright © 2011-2022 走看看