Home > Web Front-end > CSS Tutorial > Set shorthand properties for all animated properties using CSS

Set shorthand properties for all animated properties using CSS

WBOY
Release: 2023-09-18 09:49:02
forward
1208 people have browsed it

使用 CSS 设置所有动画属性的简写属性

The shorthand property for setting all animation properties is animation. It sets the animation duration, animation name, etc.

You can try running the following code to use the animated shorthand attribute:

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 150px;
            height: 200px;
            background-color: yellow;
            animation: myanim 2s
         }
         @keyframes myanim {
            from {
               background-color: green;
            }
            to {
               background-color: blue;
            }
         }
      </style>
   </head>
   <body>
      <div></div>
   </body>
</html>
Copy after login

The above is the detailed content of Set shorthand properties for all animated properties using CSS. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template