What is the use of ‘animation-timing-function’ in animation, and how is it used on a website?

The animation-timing function specifies the speed curve of the animation. The speed curve defines the TIME an animation uses to change from one set of CSS styles to another.

Syntax: div {

 animation-timing-function: linear;

}

Sample Code:

<head>

<style> 

div {

 width: 100px;

 height: 100px;

 background: red;

 position: relative;

 animation: mymove 5s infinite;

 animation-timing-function: linear;

}

@keyframes mymove {

 from {left: 0px;}

 to {left: 200px;}

}

</style>

</head>

<body>

<h1>The animation-timing-function Property</h1>

<p>Play an animation with the same speed from beginning to end:</p>

<div></div>

</body>

</html>

Leave a comment

Your email address will not be published. Required fields are marked *