Developer tool

CSS Gradient Generator

Create linear and radial CSS gradients visually, then copy a ready-to-use background rule.

Gradient settings

90°
CSS background
background: linear-gradient(90deg, #635BFF, #00D4FF);

About the Handiwork CSS Gradient Generator

The CSS Gradient Generator creates a two-color linear or radial gradient and shows the exact background declaration beside a live preview. Choose the start and end colors, set a direction for linear gradients, and copy valid CSS without translating visual controls by hand.

How to use the Handiwork CSS Gradient Generator

  1. Choose the start and end colors with the two color controls.
  2. Select a linear or radial gradient. For a linear gradient, adjust the angle with the slider or a preset.
  3. Review the live preview, then copy the complete CSS background declaration.

Linear and radial gradients serve different layouts

A linear gradient blends colors along a straight axis, which works well for page backgrounds, banners, and directional overlays. A radial gradient begins near the center and expands outward in a circle, which is useful for spotlights, glows, and soft focal areas. Switching the type preserves both selected colors so you can compare treatments quickly.

How CSS gradient angles work

For a linear gradient, 0 degrees points upward, 90 degrees points right, 180 degrees points downward, and 270 degrees points left. Diagonal presets sit between those directions. The preview and generated code update together, so the displayed angle is the angle included in the linear-gradient function.

Use gradients without losing readability

Text placed over a gradient can encounter a different background color at each position. Test contrast at the weakest point, including responsive layouts where the text may move. A solid overlay, scrim, or separate text surface can provide more dependable contrast than relying on the gradient colors alone.

Assumptions and limitations

  • This generator creates two-color gradients without additional color stops, stop positions, transparency controls, or repeating gradients.
  • The preview shows CSS color interpolation as rendered by the current browser; appearance can vary slightly across displays and color profiles.
  • A visually appealing gradient does not guarantee accessible text contrast across every point of the background.

Frequently asked questions

What CSS does the generator produce?

It produces a complete background declaration using either linear-gradient(angle, start, end) or radial-gradient(circle, start, end).

Why does the angle disappear for radial gradients?

The angle controls the direction of a linear gradient. This tool uses a centered circular radial gradient, so a directional angle does not apply.

Can I use the generated gradient commercially?

Yes. The output is ordinary CSS created from the colors and settings you choose, so you can use it in personal or commercial projects.

Go deeper

Understand the method and trade-offs

All developer tools