Home  >  Article  >  Web Front-end  >  What is the tilt code in css animation

What is the tilt code in css animation

WBOY
WBOYOriginal
2021-12-22 15:26:504294browse

The code for tilt in css animation is "transform:skewX (tilt angle value)"; the function of the transform attribute is to allow us to rotate, scale, move or tilt the element, and the function of the skewX() function is Defines the oblique transformation of the element.

What is the tilt code in css animation

The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.

What is the tilt code in css animation

In css, you can use the animation attribute to bind a rotation and displacement animation to an element.

Use the @keyframes rule to set the animation action keyframes of the element, use the transform attribute with the rotate() function to set the element's rotation action, and use the transform attribute with the skewX() function to set the element's tilt action.

The example is as follows:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div{
           margin:0 auto;
            width:200px;
            height:200px;
            border:1px solid #000;
            animation:fadenum 5s;
        }
        
@keyframes fadenum{
  100%{transform:skewX(30deg);}
}
    </style>
</head>
<body>
    <div></div>
</body>
</html>

Output result:

What is the tilt code in css animation

(Learning video sharing: css video tutorial)

The above is the detailed content of What is the tilt code in css animation. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:What is css inline styleNext article:What is css inline style