CSS Transition Generator
The CSS transition shorthand packs a property, duration, timing function and delay into one line, and the order trips people up. This generator lets you pick the properties to animate, drag the duration and delay in milliseconds, and choose a preset easing or paste a custom cubic-bezier curve. A live hover box previews the motion and the exact declaration is ready to copy.
How to generate a CSS transition
- Click property chips to toggle what animates: opacity, transform, background-color, color, or all. Selecting several builds one comma separated segment per property.
- Set Duration in milliseconds with the stepper, from 0 up to 3000 in steps of 50.
- Set an optional Delay in milliseconds the same way, leaving it at 0 for immediate motion.
- Pick a Timing function from the dropdown, or type a custom value such as a cubic-bezier(...) curve in the text field below it.
- Hover the preview box to feel the transition, then copy the generated CSS declaration into your stylesheet.
Examples
Single property, default easing
opacity, 300ms, ease, 0ms delay
transition: opacity 300ms ease 0ms;
Two properties at once
opacity and transform, 300ms, ease, 0ms delay
transition: opacity 300ms ease 0ms, transform 300ms ease 0ms;
Custom curve with a delay
transform, 500ms, cubic-bezier(0.4, 0, 0.2, 1), 100ms delay
transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1) 100ms;
Frequently asked questions
What order does the shorthand use?
Each segment is written as property, duration, timing function, then delay, for example opacity 300ms ease 0ms. The generator always emits durations and delays in milliseconds with the ms unit, so the order is correct every time.
Why is each property a separate segment?
The transition shorthand accepts several comma separated segments, one per property. The tool builds one segment per selected chip, which is clearer than the all keyword and avoids animating properties you did not intend to.
Can I use a custom easing curve?
Yes. Choose a preset like ease-in-out, or paste a cubic-bezier(...) value into the timing text field. Your value is passed through verbatim into the output, so a curve copied from a bezier editor lands untouched in the declaration.
What is the difference between duration and delay?
Duration is how long the change takes once it begins, and delay is how long the browser waits before starting. Both are set here in milliseconds and both are capped at 3000ms in the sliders, though larger values are valid CSS.
Should I transition the all keyword?
You can select all, but naming specific properties is usually faster because the browser does not have to watch every property for changes. It also avoids surprise animations on layout properties. The generator supports both.
Do all properties share the same duration and timing?
Yes. This tool applies one duration, one timing function and one delay across every selected property. If you need different timings per property, generate the segments separately and join them with commas.
Can I animate transform and opacity for performance?
Yes, and they are good defaults. Transform and opacity can be composited by the browser without triggering layout or paint, so transitions on them tend to stay smooth. Both are offered as chips for exactly that reason.
What happens if I pick no properties?
The engine requires at least one property, so with nothing selected the preview shows an error comment instead of a declaration. Toggle any chip on and a valid transition line appears again.
Is anything sent to a server?
No. The transition string is assembled entirely in your browser and your settings are never uploaded, so the tool works offline and keeps your code local.
Learn more
- CSS transition timing functions explained
What ease, linear, ease-in-out and cubic-bezier really do to motion, and how to pick a timing curve that feels natural instead of robotic.
Related tools
Cubic Bezier Generator
Build a custom CSS cubic-bezier() easing curve by dragging two control points. Preview the animation, pick a preset and copy the timing function.
CSS Gradient Generator
Build linear and radial CSS gradients with a live preview. Pick colors, set the angle and copy ready-to-paste background code for your site.
Box Shadow Generator
Build CSS box-shadow visually. Drag sliders for offset, blur, spread, color and opacity, see a live preview, and copy the box-shadow code.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
ASCII Table
Full ASCII table for all 128 codes with decimal, hex, octal and binary values, character names and descriptions. Search by code, hex or character.
Aspect Ratio Box Generator
Generate CSS for a responsive aspect-ratio container. Use the modern aspect-ratio property or the padding-top fallback, then copy the ready code.