CSS Gradient Generator
Create linear or radial gradients and copy the CSS.
About CSS Gradient Generator
Gradients add depth to buttons, banners and backgrounds. Choose two colors, a type and an angle, see a live preview and copy the CSS. Front-end developers and designers use it to avoid hand-writing code. Use gradients with enough contrast for any text placed on top.
Example
Input: indigo to pink at 135 degrees, linear. Output: background: linear-gradient(135deg, #6366f1, #ec4899); with a preview.
Tips for better results
- Keep gradients subtle for large backgrounds.
- Test text readability on the gradient.
- Provide a solid fallback color for old browsers if needed.
When to use CSS Gradient Generator
The CSS Gradient Generator is for front-end developers, bloggers who edit theme styles and designers who want to see a gradient before writing code. Gradients are handy for buttons, hero sections, cards and subtle page backgrounds. Choose colors, switch between linear and radial, adjust the angle and watch the live preview. When it looks right, copy the CSS and paste it into your stylesheet or builder. It saves guessing at angles and color order in code.
Real-world uses
- A developer builds a call-to-action button with a soft two-color gradient and copies the CSS directly into the site stylesheet.
- A blogger styles the header section of a landing page with a diagonal gradient taken from the colors of the site logo.
- A designer previews several angles for a banner background to find the direction that keeps the text area calm and uncluttered.
- A student learning CSS experiments with linear and radial gradients to understand how color stops and angles change the result.
Common mistakes to avoid
- Putting text over a strong gradient can make parts of it hard to read. Check contrast on the lightest and darkest areas under the text.
- Picking two very different colors can create a muddy middle band. Preview the transition and try closer colors or a different angle if it looks dull.
- Pasting only part of the generated CSS leaves out the background property name. Copy the full declaration and place it inside the correct selector.
How to use CSS Gradient Generator
- Pick Color 1 and Color 2.
- Choose the type: linear or radial.
- For linear gradients, set the angle in degrees (135 runs from top left to bottom right).
- Check the preview and copy the CSS line into your stylesheet.
Worked examples
Example 1: Defaults: #6366f1 to #ec4899, linear, 135°.
Result: background: linear-gradient(135deg, #6366f1, #ec4899);
Example 2: #0ea5e9 to #10b981, radial.
Result: background: radial-gradient(circle, #0ea5e9, #10b981);
Example 3: Two close shades of the same blue at 180°.
Result: A subtle top-to-bottom gradient for a page header.
Limitations and things to check
- It makes two-colour gradients. For more colour stops, edit the CSS by hand, for example adding a third colour after the second.
- Text on gradients can be hard to read. Check contrast at both ends.
- Radial gradients use a circle shape centred in the element.
More tools like this: Images & Design.
Want a deeper guide? Read How to Make CSS Gradient Buttons That Pass Contrast Checks.
Frequently asked questions
What is the difference between linear and radial?
A linear gradient blends colors along a straight line at a chosen angle. A radial gradient spreads colors outward from a center point in a circular or elliptical shape, which suits spotlight or glow effects.
How do I use the CSS in WordPress?
Paste the background declaration into a custom CSS box in your theme or page builder, attached to the right class or selector. Preview the page afterwards to confirm it applies as expected.
What does the angle mean?
0deg goes bottom to top, 90deg left to right, 180deg top to bottom. 135deg is a diagonal from top left.
Do CSS gradients work in all browsers?
linear-gradient and radial-gradient work in all modern browsers without prefixes.
Can I use a gradient as a text colour?
Yes, with background-clip: text and a transparent text colour, but keep a solid fallback colour.
Related tools
Color Palette Generator
Build matching color palettes from one base color.
🎨Color Contrast Checker
Check text and background contrast for accessibility (WCAG).
💻Markdown to HTML Converter
Convert Markdown text into clean HTML.
📱Social Media Image Size Guide
Up-to-date image sizes for Instagram, Facebook, X, YouTube and more.