✅ CSS code copied

🌈 CSS Linear Gradient Generator

Visually adjust angle · two‑color position · live preview · one‑click copy

45° 360°
pos %
pos %
👁️ Live Preview
⚡ Adjust sliders/colors – preview updates instantly

📝 CSS (production‑ready)

.my-element { background: linear-gradient(45deg, #3f51b5 0%, #e91e63 100%); }

📖 Online CSS Gradient Generator: From Beginner to Pro

CSS gradients are among the most popular visual effects in frontend development – from button backgrounds and card decorations to full‑screen hero images. The ng.cc online CSS gradient generator lets you visually control angle, start/end colors, and position percentages, with a live preview and one‑click copy of production‑ready CSS. No need to remember linear-gradient syntax; just drag the sliders.

🎯 Visual angle control

0° top‑to‑bottom, 90° left‑to‑right, 360° full circle. The preview responds instantly.

🎨 Two‑color position control

Set percentage stops (0%–100%) for each color to control where the gradient starts and ends.

⚡ Live CSS generation

The code panel updates with every change, providing a full background declaration.

🎲 Random gradient inspiration

Click “Random” to generate unexpected color combinations and spark new ideas.

🎯 Why frontend developers need a gradient generator

💡 CSS linear‑gradient parameters explained

🔹 Syntax

background: linear-gradient([angle], color1 position1, color2 position2);

🔹 Angle reference

🔹 Position percentages

Define where the color starts changing. For example, #3f51b5 0% means the color begins at 0%, #e91e63 100% at 100%. Adjusting these values creates hard stops or softer transitions.

🎨 Preset gradient examples

Click any swatch to load that gradient

❓ Frequently Asked Questions

Q1: Does it support radial‑gradient?
This version focuses on linear‑gradient, the most commonly used type. A radial‑gradient tool is in the works. Meanwhile you can explore our other design tools like the Grid Generator.
Q2: Can I use more than two colors?
Currently we support two‑color gradients, covering 80% of everyday needs. Multi‑color support is planned for version 2.0. For now you can copy the generated CSS and add extra color stops manually.
Q3: How do I make the gradient start at 20% and end at 80%?
Simply set the start position to 20% and the end position to 80%. The gradient will occupy the middle 60% of the element, with solid colors on the edges – a unique feature of this tool.
Q4: Is the generated CSS browser‑compatible?
linear-gradient is a CSS3 standard, fully supported in all modern browsers (Chrome, Firefox, Safari, Edge). Internet Explorer 10+ also supports it (with the -ms- prefix). The standard syntax we generate works for 99% of production environments.
Q5: Why does the preview colour look different on my screen?
Monitor calibration and colour gamut can cause slight variations. The tool uses standard HEX values, which are interpreted consistently across devices. For exact brand colours, use a calibrated display or Pantone references.
Q6: Can I save my gradient?
Click “Copy CSS” and paste it into your stylesheet – that’s your permanent save. This tool is static and does not store any data; your gradient lives only in the current browser tab.

🔗 Related Tools

This tool is part of the ng.cc design toolkit. You might also need:

⚡ All tools run locally in your browser – no data ever uploaded. Safe for commercial projects.