CSS Gradient
Build linear, radial, and conic CSS gradients visually. Adjust color stops and angles, pick a preset to start fast, then copy the CSS — ready to paste into your stylesheet.
Presets
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
background-image: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
Why use our online CSS Gradient?
Design linear, radial, and conic CSS gradients with a live preview and copy the ready-to-use CSS in one click. No designer needed — adjust colors, angle, and stops interactively.
How to use CSS Gradient
- 1Choose a gradient type
Click Linear, Radial, or Conic at the top. Linear fades between colors along a straight line, Radial radiates from a center point, and Conic sweeps colors around a point like a pie chart.
- 2Set the angle or shape
For linear and conic gradients, drag the slider or type a number to set the angle in degrees (0–360). For radial gradients, toggle between Circle and Ellipse to control the shape.
- 3Customize your color stops
Click any color swatch to open the native color picker, or type a hex value directly. Drag the position slider to move a stop anywhere from 0% to 100% along the gradient.
- 4Add or remove stops
Click Add Color Stop to insert a new stop (up to 8 total). Click the × button to remove one — at least two stops are always kept. The strip above the list shows a live preview of your current gradient.
- 5Copy the CSS
Click Copy next to CSS Output for the full background shorthand, or copy background-image separately if you need just the gradient value. Paste directly into your stylesheet.
Linear, radial, and conic gradients — when to use each
The three CSS gradient types serve different visual purposes. Linear gradients transition colors along a straight directional axis. They are the most versatile and commonly used: sky-to-ground background fades, button highlight effects, header backgrounds, and dividers. The angle parameter (0deg = bottom to top, 90deg = left to right, 135deg = diagonal) lets you orient the transition in any direction.
Radial gradients radiate from a central point outward. They create spotlight effects, glowing badges, circular button highlights, and vignette overlays. The shape can be a circle or ellipse, and the center point can be offset from the default center using position values (at top left, at 30% 70%).
Conic gradients sweep colors around a central point like the hands of a clock. They are uniquely suited for pie charts (using hard color stops), color wheels, spinning progress indicators, and angular gradient effects that are impossible with linear or radial types. Conic gradients are the newest of the three and require Safari 12.1+, Chrome 69+, and Firefox 83+ — covered by all modern browsers as of 2024.
CSS gradient color stops — controlling precisely where transitions happen
A color stop defines a color and the position along the gradient axis where that color appears at full intensity. Between two stops, colors blend smoothly. The position is expressed as a percentage (0% to 100%) or a length value (px, em, vw, etc.).
Key techniques using color stops: A hard stop is created by placing two stops with the same position or adjacent positions — for example, red 50%, blue 50% creates a sharp dividing line with no blend. This is how striped backgrounds and pie chart wedges are created.
A repeating gradient tiles a single gradient pattern: repeating-linear-gradient(90deg, transparent 0, transparent 10px, blue 10px, blue 20px) creates vertical blue stripes repeating every 20px.
Midpoint hints let you control where the midpoint of the blend falls between two stops, producing asymmetric fades. The browser default is the exact midpoint between two stops; hints shift the transition point left or right.
Multiple color stops allow complex multi-color gradients: a sunset might use orange at 0%, red at 40%, purple at 70%, and dark blue at 100%.
Performance and accessibility considerations for CSS gradients
CSS gradients are generated by the GPU rather than downloaded as image files, which makes them extremely efficient — a gradient background loads instantly and costs nothing in network requests. They also scale perfectly to any screen resolution and pixel density, including Retina/HiDPI displays, without the blurriness that affects rasterized images at non-native resolutions.
However, very complex gradients with many color stops, or large gradient backgrounds covering the full viewport, can have a repaint cost when the page scrolls or elements animate. If you notice scroll jitter or animation stuttering on a gradient background, try adding will-change: transform or transform: translateZ(0) to the element to promote it to its own GPU compositor layer.
For accessibility, never use gradient color changes as the sole means of conveying information — users with color vision deficiencies (affecting roughly 8% of men) may not perceive color transitions. Ensure sufficient contrast between text and gradient backgrounds across the entire text region, not just at one end of the gradient. Use browser developer tools to check contrast at multiple points along the gradient.
Frequently Asked Questions
What is the difference between linear, radial, and conic gradients?
- A linear gradient transitions colors along a straight line at a given angle. A radial gradient radiates out from a center point in a circle or ellipse. A conic gradient sweeps colors around a center point like the hands of a clock — great for pie-chart effects and color wheels.
Does the CSS Gradient Generator save my work?
- Yes. Your current gradient is automatically saved to your browser's local storage and restored the next time you visit, so you can pick up where you left off without losing your work.
How many color stops can I add?
- You can add up to 8 color stops. At least two stops are required to define a gradient, so the delete button is disabled when only two stops remain.
What CSS output does the tool generate?
- The tool outputs two ready-to-use lines: the background shorthand (e.g. background: linear-gradient(...)) and the background-image property. Both are standard CSS that works in all modern browsers without any prefix.
Do I need a -webkit- prefix for CSS gradients?
- No. All major browsers — Chrome, Firefox, Safari, and Edge — have supported unprefixed CSS gradients since 2014. The output from this tool uses the standard syntax and works across all modern environments without vendor prefixes.
Related Tools
Color Palette
Extract colors from images or generate harmonious palettes.
SVG Converter
Convert SVG to PNG at any resolution or ICO for favicons.
Image Compressor
Reduce file size without losing visual fidelity.
Email Signature Generator
Create professional HTML email signatures with logo, social links, and custom branding. Works with Gmail, Outlook, and Apple Mail.
Instagram Story Templates
Free customizable story templates for Instagram. Edit text, colors, and fonts — download in 1080×1920 PNG instantly.