<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          【動(dòng)畫消消樂】HTML+CSS 自定義加載動(dòng)畫 057

          共 2447字,需瀏覽 5分鐘

           ·

          2021-06-07 00:25

          效果展示

          Demo代碼

          HTML

          <!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">
              <link rel="stylesheet" href="style.css">
              <title>Document</title>
          </head>
          <body>
              <section><span></span></section>
          </body>
          </html>

          CSS

          htmlbody {
            margin0;
            height100%;
          }

          body {
            display: flex;
            justify-content: center;
            align-items: center;
            background#ed556a;
          }

          section {
            width650px;
            height300px;
            padding10px;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            border2px solid white;
          }

          span {
            width48px;
            height48px;
            display: inline-block;
            position: relative;
            background: white;
            animation: loading 3s linear infinite;
          }

          @keyframes loading {
          /*先x軸翻轉(zhuǎn)180度 后y軸翻轉(zhuǎn)180度*/
            0% {
              transformperspective(200pxrotateX(0degrotateY(0deg);
            }
            50% {
              transformperspective(200pxrotateX(-180degrotateY(0deg);
            }
            100% {
              transformperspective(200pxrotateX(-180degrotateY(-180deg)
            }
          }

          原理詳解

          步驟1

          使用span標(biāo)簽,設(shè)置為

          • 寬度、高度均為48px
          • 背景色:白色
            width: 48px;
          height: 48px;
          background: white;

          效果圖如下

          步驟2

          為span添加動(dòng)畫

          • 先繞x軸翻轉(zhuǎn)180度
          • 后繞y軸翻轉(zhuǎn)180度
          @keyframes loading {
          /*先x軸翻轉(zhuǎn)180度 后y軸翻轉(zhuǎn)180度*/
          0% {
          transform: perspective(200px) rotateX(0deg) rotateY(0deg);
          }
          50% {
          transform: perspective(200px) rotateX(-180deg) rotateY(0deg);
          }
          100% {
          transform: perspective(200px) rotateX(-180deg) rotateY(-180deg)
          }
          }

          效果圖如下

          結(jié)語

          希望對(duì)您有所幫助

          如有錯(cuò)誤歡迎小伙伴指正~

          我是 海轟?(?ˊ?ˋ)?

          如果您覺得寫得可以的話

          請(qǐng)點(diǎn)個(gè)贊吧

          謝謝支持??


          瀏覽 48
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  午夜精品一区二区三区在线视频99 | 拍拍免费网站视频观看 | 欧美三级网址 | 精品久久福利视频 | 蜜桃AV秘 无码一区二区三区 |