CSS Transition Generator

Choose what changes, how long it takes and its easing, then hover the preview to feel it. Short transitions, around 0.2 to 0.4 seconds, usually feel natural.

CSS Transition Generator

Website Tools

Runs locally in your browser.

Generate transition CSS with an interactive hover preview. Runs locally.

Hover the box to preview the transition

CSS

About the CSS Transition Generator

When a website visitor interacts with an interface element, be it a hover action or a focused input field, a sudden change in color might turn out to be a harsh experience for the user. CSS transitions allow you to make an element transition from one state to another over a certain period of time. However, finding a perfect balance between a too quick and a too slow animation involves a tiresome process of editing the CSS transition code in your code editor and refreshing the page in your browser.

With the CSS Transition Generator, you do not have to waste hours upon hours in the arduous cycle of coding, previewing and adjusting transition timing in your browser. You can experiment with a variety of premade hover effects, customize the timing with intuitive sliders and see the results in a live preview. When satisfied with the chosen animation, you can simply copy the CSS code for your project.

Key Features of CSS Transition Generator

  • Interactive Hover PreviewNo more guesswork regarding your CSS transition’s effect on your website. See exactly what hover interaction you are going to get with a click of a mouse.
  • Precision Timing ControlsDial in the exact feel of a transition with intuitive, responsive sliders that affect the transition’s "Duration" and an initial "Delay".
  • Pre-Built Hover EffectsSave time and experimentation with commonly used UI interactions. Pick the "Scale up (1.1)" effect from the list and see it applied to the preview box.
  • Complete Code GenerationUnlike many similar CSS generators, this tool includes a full CSS block with both the ".element" base styling and the ".element:hover" transition effect applied. Simply copy the code to your clipboard and implement it in your project.
  • Local processingThe CSS Transition Generator runs in your browser. This way, there is no loading time between adjusting transition settings and seeing the new result in the preview.

How to Use CSS Transition Generator

  1. Select the CSS "Property" you want to transition using the first dropdown menu. Choose the "Timing function" to determine the rate of the transition’s acceleration. Adjust the "Duration" and "Delay" sliders to affect the transition timing in seconds. Finally, select a "Hover effect" to be applied to the preview box from the bottom menu. Hover your mouse over the preview box to see how your CSS transition would behave on a real website. Click the "Copy CSS" button to copy the code for your transition to your clipboard.

CSS Transition Generator Examples

A transition with a scale effect on hover.

Input
Default options
Result
.element {
  transition: all 0.3s ease 0s;
}
.element:hover {
  transform: scale(1.1);
}

CSS Transition Generator — Frequently Asked Questions

What is the difference between a CSS Transition and a CSS Animation?
A CSS transition is a process of changing an element’s property from one value to another over a certain period of time. It always requires a trigger, such as a website visitor hovering over a button with their mouse. In contrast, a CSS animation (defined with the @keyframes ) can have a trigger as well, but it can also be autoplaying when the page loads or have an infinite loop count to create a loading animation.
What does the "ease" timing function do?
The default "ease" value automatically accelerates and decelerates a CSS transition. It is the most common type of transition because it resembles real-life movements the best. Essentially, it makes an element behave intuitively, the way an object in the physical world would.
Why is the transition property applied to the base element instead of the hover state?
If you define a transition inside the :hover { }, it will only affect the transition of the element when it is being hovered. In other words, a hovered element would smoothly transition to the :hover { } state, but when the mouse leaves, it would instantly revert to the initial state. To prevent that, we define the transition in the base element, so that it affects both the :hover { } and the initial state.