Linear vs radial — pick the shape first
A gradient is just a smooth blend from one color to another, and CSS gives you two basic shapes. A linear-gradient travels in a straight line, so the color shifts as you move across or down the element. A radial-gradient spreads outward from a center point like ripples, so the color shifts as you move away from the middle.
Linear is your everyday workhorse for buttons, hero sections, and backgrounds. Radial is the one to reach for when you want a soft glow, a spotlight effect, or a sense of depth radiating from a focal point.
Direction and angle, demystified
For linear gradients, the direction just tells the browser which way the colors should flow. You can use friendly keywords like "to right" or "to bottom", or you can use an angle in degrees for full control.
Angles are measured clockwise, with 0deg pointing straight up. So 90deg flows left to right, 180deg flows top to bottom, and 45deg runs diagonally toward the top-right corner. If a gradient ever looks flipped from what you expected, nudging the angle by 180 degrees usually sets it right.
Why some gradients look muddy in the middle
Ever blend two bright colors and watch the middle turn into a dull gray? That happens because the colors are blended through their raw RGB channels, and the midpoint of two opposite hues can land on a washed-out, low-saturation value.
The easy fix is to add one or more intermediate color stops so the blend takes a more flattering path instead of cutting straight through the dead zone. Bumping up the number of steps gives the eye a smoother ride and keeps the colors feeling alive from end to end.
Copying the CSS and using it well
Once the preview looks right, the copy button hands you the full background declaration, ready to paste. You can drop a gradient anywhere a color works — on backgrounds, and with a little extra setup, even on text and borders.
A practical tip: gradients are purely decorative, so keep any text sitting on top readable by checking it against the darker end of the blend. And because gradients are drawn by the browser rather than loaded as an image, they stay razor sharp at any size and add nothing to your page weight.
Small touches that make gradients feel premium
Subtlety usually wins. A gentle gradient between two close shades of the same hue reads as polished and modern, while a rainbow slammed across a whole page tends to look dated. When in doubt, keep the two end colors near each other on the wheel.
Layering a faint gradient over a flat brand color is a quick way to add depth without redesigning anything, and pairing a linear background gradient with a soft radial highlight can fake the look of real lighting. Generate the stops here, copy the code, and tweak the numbers until it feels right.