How to Make a Gradient Background

Gradient types, how to pick colors, and what to watch for when you put text on top.

6 min read · Updated 2026-10-04

A gradient (colors that change gradually) adds depth and mood more easily than a solid background. You can use one right away as a thumbnail, card or banner background, even without a photo.

Types of gradients

TypeWhat it doesWorks well for
LinearColors change in one directionBanners, card backgrounds
RadialSpreads out from the centerBackgrounds that highlight a focal point
DiagonalA linear gradient at an angleWhen you want a dynamic feel

Picking two colors

Two very different colors make the transition look distinct, while two shades of the same family (for example two blues) blend smoothly. To take colors from a photo, extract two main colors with the Color Palette Generator and put them into the Gradient Generator.

Advertisement (guide-mid)

Step by step

  1. Open the Gradient Generator.
  2. Pick a start color and an end color, or use HEX codes you extracted from a photo.
  3. Choose the type (linear, radial or conic) and the angle.
  4. Save it as an image (the PNG is 1920×1080) or copy the ready-to-use CSS code.

Which gradient suits which mood?

Blue linear gradients are often used for a cool, trustworthy mood, while orange and yellow suit a lively, warm feel. For a premium look, gradients from black to deep purple or navy are popular. The mood-based color table in our color scheme guide works for choosing the two gradient colors too.

Gradient vs. solid vs. photo backgrounds

Solid backgrounds are clean but can look plain, and photo backgrounds are rich in mood but text easily gets lost. Gradients sit in between: they add depth without a photo, and it's fairly easy to predict where text will sit. They are especially useful for content where photos are hard to find (informational posts, notices and so on).

Putting text on a gradient

Gradients are often light on one side and dark on the other, so a single text color may not read well on both. It's safer to add an outline or shadow to the text, or to choose colors whose brightness barely changes where the text will go.

What angle works best?

There is no single answer, but many people find 135 degrees (top left to bottom right) natural and balanced. A slight tilt adds more energy than perfectly horizontal (0 degrees) or vertical (90 degrees). Try a few angles and keep the one that fits your design best.

Good vs. bad examples

Common mistakes

Checklist

FAQ

Can I layer a photo with a gradient?

Yes. Placing a semi-transparent gradient over a photo lets you adjust its brightness and add mood.

How do I use the CSS code?

Paste the copied code into your website's background style and the same gradient is applied. No coding knowledge is needed; just copy and paste.

How many colors can a gradient have?

The tool starts with two colors, and you can add more up to five. Starting with two is the easiest way to keep it clean.

Do I need to think about fonts on a gradient background?

Yes. Because the brightness changes across the background, a bold font with an outline reads more reliably everywhere than a thin font.

Try it now

Advertisement (guide-end)