码迷,mamicode.com
首页 > Web开发 > 详细

css3 地球自转公转

时间:2021-04-08 13:22:19      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:turn   mes   meta   Fix   transform   animation   origin   -o   doctype   

<!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>Document</title>
  <style>
    div.box {
      width:100px;
      height: 100px;
      position: fixed;
      left: 45vw;
      top: 20vh;
      animation: turnBox 10s linear infinite;
      transform-origin: 0px 200px;
    }
    div.diqiu {
      width:100px;
      height: 100px;
      background: linear-gradient(rgb(243, 236, 236), rgb(72, 151, 241));
      border-radius: 50px;
      animation: turn 20s linear infinite;
      text-align: center;
      line-height: 100px;
    }
    @keyframes turnBox {
      0% {
        transform: rotate(0deg);
      }
      50% {
        transform: rotate(180deg);
      }
      100% {
        transform: rotate(360deg);
      }
    }
    @keyframes turn {
      0% {
        transform: rotate(0deg);
      }
      50% {
        transform: rotate(180deg);
      }
      100% {
        transform: rotate(360deg);
      }
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="diqiu">Earth</div>
  </div>
</body>
</html>

 

css3 地球自转公转

标签:turn   mes   meta   Fix   transform   animation   origin   -o   doctype   

原文地址:https://www.cnblogs.com/-roc/p/14627309.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!