ホームページ  >  記事  >  ウェブフロントエンド  >  アニメーションの速度カーブを設定するために使用される CSS プロパティはどれですか?

アニメーションの速度カーブを設定するために使用される CSS プロパティはどれですか?

PHPz
PHPz転載
2023-09-05 15:29:061388ブラウズ

使用哪个 CSS 属性来设置动画的速度曲线?

animation-timing-function を使用して、アニメーションの速度カーブを設定します。次のコードを実行して、イーズおよびイーズイン アニメーション効果をセットアップしてみてください:

サンプル

ライブ デモ

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 150px;
            height: 200px;
            position: relative;
            background-color: yellow;
            animation-name: myanim;
            animation-duration: 2s;
            animation-direction: alternate-reverse;
            animation-iteration-count: 3;
         }
         @keyframes myanim {
            from {left: 100px;}
            to {left: 200px;}
         }
         #demo1 {animation-timing-function: ease;}
         #demo2 {animation-timing-function: ease-in;}
      </style>
   </head>
   <body>
      <div id = "demo1">ease effect</div>
      <div id = "demo2">ease-in effect</div>
   </body>
</html>

以上がアニメーションの速度カーブを設定するために使用される CSS プロパティはどれですか?の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事はtutorialspoint.comで複製されています。侵害がある場合は、admin@php.cn までご連絡ください。