Skip to content
hexcolorcodepicker.com

CSS Gradient Generator

Build your gradient

Type:

#3B82F6 at one end, #FF5733 at the other.

Build a CSS gradient from two colors with an angle slider and a linear or radial switch. Preview it live, then copy the ready-to-paste background CSS.

What is a CSS gradient?

A CSS gradient is a smooth blend from one color into another, drawn by the browser with one line of CSS. No image file is needed: the browser paints the blend itself, so the gradient stays sharp at any screen size and adds no download weight to the page. That is why gradients are used for hero backgrounds, buttons, and cards.

The two colors in this tool are #3B82F6, a medium blue, and #FF5733, a warm orange-red. Blue to orange-red is a strong contrast blend, so it shows the gradient effect clearly — the middle of the blend is a visible purple-brown where the two colors meet.

Live gradient bar — it follows the two colors in the tool above

Start #3B82F6End #FF5733

Linear gradients and the angle

A linear gradient blends in a straight line, and the angle sets the direction of that line. An angle of 0° runs bottom to top, 90° runs left to right, 180° runs top to bottom, and 270° runs right to left. The default 135° runs from the top-left corner to the bottom-right corner, which is the most common direction for page backgrounds.

Dragging the slider is the fastest way to learn the angles: watch the preview rotate as the number changes, and stop when the blend runs the way your design needs. The CSS updates with the slider, so the copied line always matches the preview on screen.

Angle dial — the arrow points the way the blend runs

0° is up

Angle: 135° — 0° runs bottom to top, 90° left to right, 180° top to bottom, 270° right to left.

Radial gradients

A radial gradient blends outward from a center point, like rings spreading on water. The start color sits in the middle and the end color forms the outer edge. It suits circular highlights, spotlights behind a heading, and soft glows much better than a straight linear blend.

The radial CSS for the default colors is background: radial-gradient(circle, #3B82F6, #FF5733);. The word circle keeps the shape round; without it the browser stretches the gradient into an ellipse that follows the panel shape. This tool always writes circle so the result is predictable.

Radial preview — start color at the center dot, end color at the edge

Center: #3B82F6 — edge: #FF5733

How to use the CSS on your site

Copy the CSS line and paste it as the background of any element. The copied line is a complete declaration: background: linear-gradient(135deg, #3B82F6, #FF5733);. Paste it into a class in your stylesheet, and every element with that class gets the gradient. Add a plain background-color line before it as a fallback for very old browsers.

Use gradients sparingly: one gradient hero or one gradient button per page is enough. Two or three different gradients on one screen compete with each other and make the page look busy, so pick one direction and one color pair and reuse it.

The exact CSS line the tool copies

background: linear-gradient(135deg, #3B82F6, #FF5733);A button wearing the same gradient

Copy the line from the tool above, paste it as the background of any element.

Choosing two colors that blend well

Two colors blend well when they are far enough apart in hue to show a change, but close enough in lightness to stay smooth. Blue #3B82F6 and orange-red #FF5733 sit almost opposite each other, so their blend is bold and visible. Two near-identical blues would blend so gently that the gradient is barely visible.

If the middle of your blend turns muddy gray or brown, the two colors are fighting each other. Fix it by picking colors that are closer in hue — for example two blues — or by accepting the bold middle as a feature and using the gradient only in a thin strip.

Blend midpoint inspector — the exact middle of the blend

Midpoint color: #9D6D95 — the 50/50 mix of the two colors.

All color tools

21 tools, one topic — see About Hex Color Code Picker for who built this site.

Frequently asked questions

Pick two colors, set the angle, and copy the CSS line. The defaults are #3B82F6 to #FF5733 at 135°, which gives background: linear-gradient(135deg, #3B82F6, #FF5733);. Paste that line as the background of any element in your stylesheet.