Animated Gradient Background Generator
Choose two to five colours, an angle and a duration, and copy CSS that slides an oversized gradient back and forth.
Choose two to five colours, an angle and a duration, and copy CSS that slides an oversized gradient back and forth.
CSS cannot animate the colours of a gradient directly, so the usual trick is to make the gradient much larger than the element and animate background-position to slide it around.
Choose your colours, angle and speed and copy the CSS. There is no live preview, because gradients and animations are switched off on this page; paste the code into your own page to see the movement.
background-size: 400% 400%; animation: gradient-shift 12s ease infinite;
The gradient must be larger than the element for there to be anything to slide. 400% gives plenty of travel.
Animating background-position repaints the element every frame. It is fine for one large section but avoid many animated elements.
Apply the class to body or a full-height wrapper and give it min-height: 100vh.
Raise the duration. Values between 10 and 20 seconds feel calm.
Constant motion can bother some people, so the output turns it off when prefers-reduced-motion is set. Keep text contrast high across all colours.