CSS Gradient Generator
Generate CSS linear and radial gradients with live preview. Pick colors, adjust angles, and copy the code.
Quick Answer
CSS gradients use the background property: background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); — adjust the angle and colors to match your design.
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);About This Tool
The CSS Gradient Generator creates production-ready CSS gradient code with a live visual preview. Gradients are one of the most commonly used CSS properties for adding visual depth and interest to websites. This tool supports both linear and radial gradients, lets you pick any two colors, adjust the angle and color stops, and copy the code in one click.
Linear vs. Radial Gradients
Linear gradients transition colors along a straight line defined by an angle. A 0-degree gradient goes from bottom to top, 90 degrees goes left to right, and 180 degrees goes top to bottom. Radial gradients transition colors outward from a center point in a circular or elliptical shape. Linear gradients are more common for backgrounds and section dividers, while radial gradients work well for spotlight effects and button highlights.
Color Stop Positions
Color stops define where each color begins and ends in the gradient. By default, two colors split evenly (0% and 100%). Moving the stops closer together creates a sharper transition, while spreading them apart creates a softer blend. You can also create hard color boundaries by placing two stops at the same position, which is useful for striped or banded effects.
Browser Support
CSS gradients are supported in all modern browsers including Chrome, Firefox, Safari, Edge, and mobile browsers. The syntax used by this generator does not require vendor prefixes. If you need to support very old browsers (IE9 and below), provide a solid fallback color before the gradient declaration.
Frequently Asked Questions
Can I add more than two colors?
How do I make a gradient text effect?
What is the best angle for a gradient background?
Can I animate CSS gradients?
How do I create a transparent gradient overlay?
You might also like
JSON to YAML Converter
Convert between JSON and YAML formats with real-time preview.
⏱ instantDev ToolsBase64 Encoder & Decoder
Encode and decode Base64 with URL-safe mode and file upload.
⏱ instantDev ToolsColor Contrast Checker
Check WCAG 2.1 AA & AAA contrast ratios with color blindness simulation.
⏱ instant