How to use the CSS Gradient Generator
- 1Select Linear or Radial gradient mode—or click Violet Dusk, Oceanic Slate, or Warm Dawn to load a built-in starter preset.
- 2When Linear mode is active, drag the Angle slider between 0° and 360° to rotate the gradient direction.
- 3Pick each color stop using its color picker and adjust its 0%–100% position slider, or click Add Stop to insert extra color transitions.
- 4Inspect the live gradient preview banner at the top and click Copy inside the dark CSS code bar at the bottom.
What the CSS Gradient Generator does
The visual builder updates both the live gradient preview and standard unprefixed CSS syntax directly inside your browser:
- Generates clean linear-gradient(angle, ...) and circular radial-gradient(circle, ...) background declarations with zero vendor prefixes.
- Automatically sorts color stops by percentage from 0% to 100% so your visual transitions stay smooth even if you drag sliders past one another.
- Includes Add Stop and per-stop Remove buttons while ensuring at least two color stops always remain active.
- Offers three starter presets—Violet Dusk, Oceanic Slate, and Warm Dawn—alongside a dark syntax output bar with a Copy button.
Example
Type: Linear | Angle: 135deg | Stops: #241547 at 0%, #7839ee at 50%, #38bdf8 at 100%
background: linear-gradient(135deg, #241547 0%, #7839ee 50%, #38bdf8 100%);
Switching the mode toggle to Radial converts the same sorted color stops into background: radial-gradient(circle, #241547 0%, #7839ee 50%, #38bdf8 100%); immediately.
Frequently asked questions
What is the difference between a linear gradient and a radial gradient?
A linear gradient blends colors smoothly along a straight line defined by an angle such as 90deg or 135deg. A radial gradient blends outward in a circular shape starting from the center toward the outer stops.
Do generated CSS gradients work in all modern browsers?
Yes. Standard unprefixed linear-gradient() and radial-gradient() rules are natively supported across all modern desktop and mobile browsers without vendor prefixes.
How can I add transparency to a CSS gradient?
In the generated CSS rule, replace any hex color stop such as #7839ee with an RGBA, HSLA, or 8-digit hex value (for example rgba(120, 57, 238, 0.5) or #7839ee80) or transparent where you want underlying elements to show through.
How many color stops can I add?
You need at least two stops to form a gradient, and you can click Add Stop to append additional intermediate colors and position them anywhere from 0% to 100%.
Related tools
View All ToolsHEX to RGB Converter
Convert HEX (3/6/8-digit), RGB(A), and HSL(A) colors in your browser with a native color picker, live swatch, and white/black contrast ratios.
CSS Box Shadow Generator
Build multi-layer CSS box-shadow styles visually with sliders for horizontal/vertical offset, blur, spread, color opacity, and inset shadows.
CSS Minifier
Compress CSS stylesheets: strips comments, whitespace, and collapses declarations for faster rendering.