🌈 CSS Gradient Generator
Build beautiful CSS gradients with live preview. Choose linear, radial, or conic, add color stops, pick presets, and copy the CSS code.
Gradient Type
90°
Direction Presets
Color Stops
Presets
CSS Code
A Complete Guide to CSS Gradients — Linear, Radial, and Conic
CSS gradients let you create smooth transitions between two or more colors entirely in code — no image files needed. They are resolution-independent, render instantly, and can be animated, making them one of the most versatile tools in modern web design.
Types of CSS Gradients
- linear-gradient — transitions colors along a straight line defined by a direction keyword (e.g.
to right) or an angle (e.g.135deg). Each color stop can include an optional position percentage. - radial-gradient — radiates colors outward from a center point in a circle or ellipse. You can control the shape, size, and origin position (e.g.
circle at top left). - conic-gradient — sweeps colors around a center point like a pie chart, starting from a given angle. Ideal for color wheels, progress indicators, and decorative backgrounds.
- Repeating variants —
repeating-linear-gradient,repeating-radial-gradient, andrepeating-conic-gradienttile the gradient pattern to fill the element, perfect for stripes and geometric textures.
Creative Uses for CSS Gradients
- Hero image overlays — layer a semi-transparent gradient over a background image to improve text contrast and readability.
- Text gradients — combine
background-clip: textwith a gradient background and transparent text color to create eye-catching gradient text effects. - Animated gradient borders — use
@propertyorbackground-sizeanimation to create borders that shift color smoothly on hover. - Mesh-gradient effects — stack multiple radial gradients at different positions and blend them for a soft, organic mesh-gradient look without JavaScript.
- Gradient buttons and hover effects — apply a gradient background with a shifted
background-positionon hover for a fluid color-change transition. - Replacing image backgrounds — swap out decorative background images for CSS gradients to eliminate HTTP requests and improve page load speed.
Browser Support and Fallbacks
All modern browsers fully support linear-gradient and radial-gradient. conic-gradient enjoys over 95% global browser support. Vendor prefixes are no longer needed for current browsers. As a best practice, always declare a solid background-color before your gradient rule so older browsers that lack support still display a usable background.
Frequently Asked Questions
Linear (with custom angle), radial (circle or ellipse with position), and conic gradients. Each supports multiple color stops.
Linear and radial gradients work in all modern browsers. Conic gradients have broad support but may need a fallback for older browser versions.
Yes. CSS gradients are resolution-independent, load instantly with no HTTP request, and can be animated. They outperform images in almost every scenario.
Yes. Add up to 8 color stops, each with a color picker and position slider (0-100%). More stops create more complex effects.
Copy the CSS code and apply it as a background property to any HTML element, e.g.
background: linear-gradient(90deg, #ff0000 0%, #0000ff 100%);