Build beautiful CSS gradients visually. Real-time preview and one-click copy.
background: -webkit-linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%); background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
CSS provides three native gradient functions that cover virtually every design use case. linear-gradient() transitions colors along a straight line at any angle β the most common type used for button backgrounds, hero sections, and card accents. radial-gradient() radiates colors outward from a focal point in either a circular or elliptical shape, useful for spotlight effects, glows, and radial decorative elements. conic-gradient() sweeps colors around a central point like a pie chart, making it ideal for progress rings, color wheels, and angular decorative patterns.
All three gradient types are defined in the CSS Images specification and are fully supported in all modern browsers. No JavaScript or external libraries are required β gradients are pure CSS and render entirely on the GPU, making them highly performant even on mobile devices.
linear-gradient(red 50%, blue 50%) produces a crisp split rather than a blend.red, 30%, blue) shifts where the transition midpoint falls, giving you finer control over how quickly one color bleeds into the next.rgba() or 8-digit hex like #ff000080) to create gradients that fade to transparent, useful for overlays and text-shadow effects.linear-gradient and radial-gradient. The -webkit- prefix is only needed for Safari versions older than 12.1 (released 2019), which represent a negligible share of traffic for most sites.background-position on an oversized static gradient instead of animating color values.CSS cannot directly transition gradient color values, but you can fake it elegantly. The most common technique: set a large background (e.g., 400% width), then animate background-position with a CSS @keyframes animation. Another approach uses pseudo-elements β place the new gradient on ::after and animate its opacity from 0 to 1, creating a smooth cross-fade between two gradients.
Yes: apply the gradient as background on the text element, then add -webkit-background-clip: text; -webkit-text-fill-color: transparent;. This clips the gradient to the shape of each letter. The -webkit- prefixes are still required for this specific property even in non-WebKit browsers (they all implement the WebKit alias).
circle constrains the gradient to a perfect circle regardless of the element's aspect ratio. ellipse (the default) stretches to match the element's bounding box β so it looks circular only in square elements and stretches in rectangles. For spotlight effects, circle usually looks more natural.
Use repeating-linear-gradient(), repeating-radial-gradient(), or repeating-conic-gradient(). These repeat the stop pattern indefinitely. Example: repeating-linear-gradient(45deg, #000 0px, #000 10px, #fff 10px, #fff 20px) creates a classic diagonal stripe pattern.