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.
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:
(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!