Loading Please Wait...
CSS transitions allows you to change property values smoothly, over a given duration.
CSS transitions provide a way to control animation speed when changing CSS properties, like during mouse hover, click, etc.
To define the transition, we have following properties:
transition-property: specifies the name or names of the CSS properties to which transitions should be applied such as width, height, font-size, all, etc. The value all can be used to select all properties to which transition can be applied.
transition-duration: specifies the duration over which transitions should occur.
transition-delay: Defines how long to wait between the time a property is changed and the transition actually begins.
transition-timing-function: specifies a function to define how intermediate values for properties are computed.
The transition-timing-function property can have the following values:
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: #1a1e49;
transition-property: width;
transition-duration: 2s;
transition-delay: 1s;
transition-timing-function: linear;
}
div:hover {
width: 200px;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
The CSS transition is a shorthand property to handle all transition sub properties in a single line.
transition: property duration timing-function delay;
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: #1a1e49;
transition: width 3s linear 1s;
}
div:hover {
width: 200px;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: #1a1e49;
transform: rotate(0);
transition: width 2s, height 2s, transform 2s;
}
div:hover {
width: 200px;
height: 200px;
transform: rotate(45deg);
}
</style>
</head>
<body>
<div></div>
</body>
</html>
How you feel about this blog:
Share this blog on:
If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com
Contact UsWe are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..
Copyright ©
, Lynxsia IT Solutions, All rights reserved