CSS Gradient Generator
Pick a type of gradient, choose your colours and see the result at once. Linear, radial and conic gradients are supported, with repeating versions, up to ten colour stops, an angle or a centre point, and a fallback colour. Copy the CSS with one click and paste it into your stylesheet. Everything runs in your browser.
Colours
- %
- %
background-color: #ff512f; background: linear-gradient(90deg, #ff512f 0%, #dd2476 100%);
Related Tools
[7 suggestions]Color Converter and Contrast Checker
Convert a color between HEX, RGB and HSL, look up CSS color names, and check the WCAG contrast ratio of text on a background.
Developer & WebPX to REM Converter
Convert px to rem, em, pt, pc, vw and percent for CSS, with your own root font size, parent size and viewport width.
Developer & WebAspect Ratio Calculator
Find the aspect ratio of any width and height, resize while keeping it, and get the CSS aspect-ratio rule.
Developer & WebOpen Graph Generator
Live-generate OG and Twitter Card meta tags for rich social media sharing previews.
SEO & MarketingCSS Shadow Generator
Design box-shadow, text-shadow and drop-shadow with several layers, preview them live and copy the CSS.
Developer & WebHTML to Image Converter
Turn HTML and CSS into a PNG, JPEG, WebP or SVG image in your browser, with a live preview, any size, a 1x to 4x scale and a transparent background.
Developer & WebColor Contrast Checker
Check the WCAG contrast ratio of a text and a background color, see AA and AAA results for text and interface parts, and get the nearest colors that pass.
Developer & WebAbout the CSS Gradient Generator
The CSS gradient generator builds the value of the background property for you. A linear gradient blends colours along a line at an angle, where 0 degrees points up and 90 degrees points right. A radial gradient spreads colours outward from a centre as a circle or an ellipse, and a conic gradient sweeps them around a centre like a colour wheel, starting at the angle you choose. Each colour stop has a position in percent, and two stops at the same position make a hard edge, which is how stripes are drawn. The repeating option repeats the pattern across the box, using the distance between your first and last stop as the length of one repeat. The tool sorts your stops by position, writes colours as lower case hex values and accepts the short form such as #f80 and eight digit colours with transparency. The first line of the output can be a plain colour, so browsers that cannot draw the gradient still show something. The CSS was tested in Chromium: 800 random gradients of every type were drawn and more than 200,000 pixels were compared with an independent calculation of the same gradient, written from the CSS rules, and the largest difference was one level of colour out of 255. Everything runs in your browser and nothing is uploaded.
How do I make a CSS gradient?▾
Write a value such as linear-gradient(90deg, #ff512f 0%, #dd2476 100%) for the background property. The first part sets the direction, and each colour is followed by its position. This tool builds the value and shows a preview as you change the colours.
What do the angles of a linear gradient mean?▾
An angle of 0 degrees points to the top, 90 degrees to the right, 180 degrees to the bottom and 270 degrees to the left. The colours run along that direction, so 135 degrees goes from the top left corner to the bottom right.
How do I make a hard edge or stripes?▾
Give two colour stops the same position, such as blue at 50% and white at 50%. The colour changes at once with no blend. Tick Repeating and use stops such as blue 0%, blue 10%, white 10% and white 20% to repeat the stripe.
What is a conic gradient?▾
A conic gradient turns colours around a centre point, like the slices of a pie, instead of along a line. It is used for colour wheels, pie charts and sweeping effects. The start angle sets where the first colour begins.
Is my data uploaded?▾
No. The gradient is built in your browser, and nothing you choose is sent anywhere or stored.