css 做旋轉(zhuǎn)太極圖

實現(xiàn)效果:
https://vicfun.github.io/vs-demo/taichi.html
代碼部分:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
  <style>
    @keyframes spin {   
      from {
        transform: rotate(0deg);          /*讓太極以0度開始轉(zhuǎn)變*/
      }

      to {
        transform: rotate(360deg)       /*讓太極以360度結(jié)束轉(zhuǎn)變*/
      }
    }
    body{
        background: rgb(205,179,128);
      }
    #taichi{
      margin: 0 auto;
      width: 200px;
      height: 200px;
      border-radius: 50%;
      background: linear-gradient(to bottom, #ffffff 0%,#fcfcfc 50%,#050505 50%,#000000 99%); 
      position: relative;
      animation-duration: 3s;                  /*讓太極的旋轉(zhuǎn)速度為3s*/
      animation-name: spin;                   /*css動畫 animation*/
      animation-iteration-count: infinite;   /*讓太極無數(shù)次旋轉(zhuǎn)*/
      animation-timing-function: linear;    /*讓太極以線性速度旋轉(zhuǎn)*/
    }

    #taichi::before{
      content: '';
      border-radius: 50%;
      position: absolute;
      top: 50px;
      left: 0;
      background: #fff;
      width: 20px;
      height: 20px;
      border: 40px solid #000;
    }

    #taichi::after{
      content: '';
      border-radius: 50%;
      position: absolute;
      top: 50px;
      right: 0;
      background: #000;
      width: 20px;
      height: 20px;
      border: 40px solid #fff;
    }
  </style>
</head>
<body>
  <div id= "taichi"></div>
</body>
</html>
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • afinalAfinal是一個android的ioc,orm框架 https://github.com/yangf...
    passiontim閱讀 15,896評論 2 45
  • afinalAfinal是一個android的ioc,orm框架 https://github.com/yangf...
    wgl0419閱讀 6,602評論 1 9
  • 現(xiàn)在是16年4月12日20點55分,坐標中國某二線城市二流大學(xué)308宿舍,六人間的宿舍由五人變成六人又變成五人。雖...
    李全對閱讀 384評論 1 3
  • 自我呱呱墜地的那一刻起,我就注定與這北方有著千絲萬縷的聯(lián)系。這里沒有南方的和風細雨,有的是夏秋時節(jié)的狂風暴...
    昆山玉歲閱讀 289評論 0 0
  • 本文的圖片均非原創(chuàng),均來源自于: java Selector is asynchronous or non-blo...
    eye_water_閱讀 1,173評論 0 1

友情鏈接更多精彩內(nèi)容