Type a tool name, for example "keyword density" or "transcript".
Create beautiful CSS gradients visually and copy the code.
This CSS gradient generator lets you build linear, radial and conic gradients visually, adjust the angle, shape and color stops while watching a live preview, and copy the finished CSS in one click. It is made for developers and designers who want working background code without writing it by hand.
A CSS gradient is an image the browser draws for you, a smooth blend between two or more colors, which you apply with the background property instead of loading an image file. Because it is generated by code, it scales to any size without blurring and adds no extra download.
Every gradient is built from color stops. A color stop is a color plus a position along the gradient line, written as a percentage. A gradient from blue at 0% to green at 100% has two stops, and the browser fills in every shade between them.
You can go from a blank preview to copied CSS in about a minute by following these steps.
Say you want a left-to-right banner that moves from blue through teal to green. Load the Cool Blue preset, which uses three stops: #2196F3 at 0%, #00BCD4 at 50% and #4CAF50 at 100%. Keep the type on Linear and the angle at 90 degrees.
The CSS box then shows a background declaration along the lines of linear-gradient(90deg, #2196F3 0%, #00BCD4 50%, #4CAF50 100%). The browser paints pure blue at the left edge, pure teal exactly in the middle and pure green at the right edge.
Now drag the angle to 180. The same colors run from top to bottom, which suits a tall sidebar better. Move the middle stop from 50% to 30% and the teal band shifts left, so green takes over more of the box. Small position changes like this are the fastest way to tune the mood without touching the colors.
The preview and the CSS box always match, so the preview is your quality check and the code is your deliverable. Use the table below to decide which control to adjust when something looks off.
| What you see | Likely cause | Fix |
|---|---|---|
| Gradient runs the wrong way | Angle is off | Drag Angle until the direction matches |
| Muddy, gray middle | Opposite hues blend | Add a stop with a brighter middle color |
| One color dominates | Stops sit close to one edge | Move positions toward 0% and 100% |
| Hard line instead of a blend | Two stops share a position | Separate them by 10% or more |
Most polished interface gradients use two or three stops with colors that are close in hue, such as the Ocean or Purple presets. They look intentional and keep text readable. Gradients with four or more saturated stops can look busy, so add them only when the design truly calls for it.
If text sits on top, check contrast at the lightest and darkest parts of the gradient, not only the average. WCAG guidance asks for a 4.5:1 contrast ratio for normal body text, and a gradient can pass in one corner and fail in another.
Two stops at the same position create a sharp edge instead of a blend. Set one stop to 50% and the next also to 50% and you get a clean split, handy for two-tone backgrounds and stripes.
The generator suits anyone who needs gradient CSS faster than they can write and test it by hand. Typical situations include:
Most gradient problems come from how the CSS is applied, not from the gradient itself. These are the cases people run into most.
A gradient is a background image, so it will not work on properties that expect a plain color, such as color or background-color. Paste the copied declaration onto a background property of an element that has a width and height. An empty inline element with no size paints nothing.
The color pickers choose solid colors, so there is no opacity slider. To fade out, paste the code and replace one hex value with an rgba() color or the keyword transparent. For the cleanest fade, use the same color with zero alpha, for example rgba(102, 126, 234, 0), so the middle does not turn gray.
Apply the copied gradient to the text element, then add background-clip: text and make the text color transparent. Many browsers also need the prefixed version of the clip property, so test in the browsers you support.
For borders, the common approach is a gradient as border-image or a gradient layered behind a padded inner box. Browsers cannot smoothly transition between two gradients, so for motion, enlarge the background size and animate its position. You can build that kind of movement with the CSS animation generator.
If your project uses Tailwind, you can place the gradient inside an arbitrary background value and replace spaces with underscores. Alternatively, put the declaration in a custom class in your stylesheet.
Add a plain background-color line before the gradient, using one of your stop colors. If the gradient fails to load for any reason, the element still has a readable background.
This generator focuses on the core gradient controls. You choose the type, angle or shape, and a list of color stops, but there are no sliders for the center point or size of a radial gradient, and it does not extract colors from an uploaded image. If you need a different center, edit the copied CSS by hand, for example by adding at top left to a radial gradient.
Colors display slightly differently across screens and color profiles, so check the final result on the devices your visitors use. Very large, smooth gradients between similar colors can show faint banding on some displays, which you can reduce by adding a middle stop with a slightly different hue.
Gradients rarely work alone. Pair a gradient background with depth from the CSS box shadow generator, or style headings placed over it with the CSS text shadow generator. Once your styles are done, shrink the file with the CSS minifier. If the gradient is part of a responsive design, the CSS media query generator helps you swap angles or colors at different breakpoints. More utilities live in the web developer tools collection.
Pick a type, drag the angle, set your color stops and copy the code. Use the generator on this page to build your next background and see the exact CSS before it reaches your project.
Your report has been submitted. We will look into this issue.
A VPN changes your network exit. It does not guarantee anonymity.
Themes, plugins, code, video, audio, graphics & more from 90,000+ authors.
Web Development
Design & Media
Unlimited Access
Explore Envato Market