Discover and download high-quality CSS animations to enhance your website's design.
Keyframes in CSS allow you to define intermediary steps for animations, enabling smooth transitions between multiple states. By specifying styles at certain points (percentages) within the animation's duration, you can create complex animations.
@keyframes example {
0% { transform: rotate(0deg); }
50% { transform: rotate(180deg); }
100% { transform: rotate(360deg); }
}
After defining keyframes, use the animation
property to apply them to an element.
div {
animation: example 2s ease-in-out infinite;
}
The animation
shorthand consists of the following properties:
Property | Description |
---|---|
animation-name | The name of the keyframes block. |
animation-duration | How long the animation takes (e.g., 2s ). |
animation-timing-function | Controls the speed curve (e.g., ease-in ). |
animation-delay | Delay before starting the animation. |
animation-iteration-count | Number of times to play (or infinite ). |
animation-direction | Normal, reverse, alternate, etc. |
animation-fill-mode | Determines the styles before and after the animation runs. |
animation-play-state | Running or paused. |
Here is an example using all animation properties:
@keyframes exampleAnimation {
0% { transform: translateX(0); opacity: 0; }
50% { transform: translateX(100px); opacity: 0.5; }
100% { transform: translateX(200px); opacity: 1; }
}
div {
animation: exampleAnimation 2s ease-in-out 1s infinite alternate forwards;
/* animation-name: exampleAnimation;
animation-duration: 2s;
animation-timing-function: ease-in-out;
animation-delay: 1s;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-fill-mode: forwards; */
}
Here are some common settings for CSS animations:
Category | Values |
---|---|
Timing Functions | ease , linear , ease-in , ease-out , ease-in-out , and custom cubic-bezier values. |
Directions | normal (default), reverse , alternate , alternate-reverse . |
Fill Modes | none , forwards , backwards , both . |
Dive into the latest advancements in CSS animations.
2025-01-10Learn how to use CSS keyframes to create seamless, high-performance animations.
2025-01-11Understand the difference between CSS transitions and keyframes.
2025-01-12Learn how to make your web animations accessible to all users.
2025-01-13Explore the best tools for creating and testing CSS animations.
2025-01-14Take your animations to the next level by integrating CSS with JavaScript for interactive, dynamic effects.
2025-01-15Learn how to animate CSS Grid layouts to create engaging, dynamic web designs.
2025-01-16Ensure your CSS animations run smoothly on mobile devices by following best practices for performance.
2025-01-17Get to know how to control the timing of your animations using delays and duration for better user experience.
2025-01-18Learn how to create animations that are both engaging and accessible for all users, including those with disabilities.
2025-01-19Discover the best browser extensions that help web developers with styling, testing, and enhancing their websites, including QuickStyle.
2025-01-20Understand the process of creating and implementing CSS animations for modern web design.
2025-01-12Elevate your website's user experience with smooth page transitions using CSS.
2025-01-14Design animations that adapt to different screen sizes and devices with CSS for a responsive user experience.
2025-01-15Add depth and interactivity to your website by creating animated backgrounds with CSS.
2025-01-16