CSS transition

A CSS transition smoothly animates a property from one value to another over a set duration, for example a colour or size change on hover.
Design
Created on
23.08.2026

Summarize this

A CSS transition smoothly animates a change to a property, from one value to another, over a set duration instead of switching instantly. It is the simplest way to add motion to an interface, most often on a state change like a hover, focus or class toggle.

The four transition properties

A transition is controlled by four settings, usually written together in the transition shorthand, for example transition: background-color 200ms ease-in-out 0s;.

PropertyRoleExample
transition-propertyWhat to animatebackground-color
transition-durationHow long it takes200ms
transition-timing-functionThe paceease-in-out
transition-delayWait before starting0s

What you can transition

Only animatable properties transition. Colours, opacity, transform, dimensions and positions all work; discrete properties like display do not (though modern CSS is adding support). Transitioning transform and opacity is the smoothest because the browser can offload them to the GPU.

Transition versus animation

A transition animates a single change between two states and needs a trigger, like a hover. A CSS animation uses keyframes, can define many steps, and can run on its own or loop. Use a transition for simple hover and focus effects, and an animation for multi-step or automatic motion.

Timing functions

The timing function shapes how the change accelerates. ease starts and ends softly, linear is constant, and a custom cubic-bezier() gives full control. Keep durations short, around 150 to 300 milliseconds, so the interface feels responsive rather than sluggish.

Best practices

Name the exact properties instead of using transition: all, which can animate unintended changes and hurt performance. Pair transitions with a clear hover or focus state, and respect prefers-reduced-motion for users who are sensitive to movement.

CSS transitions at BeBranded

At BeBranded we use transitions for crisp, subtle feedback on buttons, links and cards, so an interface feels alive without distracting. It is part of the polished, performant front-end we deliver through our design work.

FAQ

A CSS transition smoothly animates a property from one value to another over a set duration, usually on a state change like a hover. It adds motion without switching instantly.
A transition animates one change between two states and needs a trigger. An animation uses keyframes, can define many steps, and can run on its own or loop. Transitions suit simple hover effects.
Most animatable properties, such as colour, background, opacity, transform and size. Transitioning transform and opacity is the smoothest because the browser can offload them to the GPU.
A timing function sets the pace of a transition, for example ease, linear, ease-in-out or a custom cubic-bezier curve. It shapes how the change accelerates and decelerates.
Common causes are a missing duration, a property that is not animatable (like display), or no change in value to animate. Check that the start and end states differ and a duration is set.
Yes. Webflow lets you add transitions in the Designer under a state like hover, which generates the matching CSS transition in the exported code.

Ready to boost your conversions?

Our team is here to understand your needs & work with you to create your next projects.
Get news, infos and resources.
Actionable tips delivered straight to your inbox.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.