CraftTools

CSS Gradient & Box Shadow Generator

Guide: px vs rem vs em: Which CSS Unit Should You Use?

Color stops
0%
100%
background: linear-gradient(90deg, #6366f1 0%, #ec4899 100%);

Nothing you enter or choose here leaves your device. This tool runs in your browser.

Gradients

Pick linear, radial or conic, add between 2 and 6 color stops, and drag the controls while the preview updates. When it looks right, Copy CSS gives you a line like this one:

background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);

The angle sets the direction. 0 degrees points up, 90 points right, 180 points down and 270 points left, so 135 runs from the top left to the bottom right.

TypeLooks likeUsed for
LinearColors blend along a lineBackgrounds, buttons, headers
RadialColors spread out from a pointSpotlights, glows, soft vignettes
ConicColors sweep around a pointPie charts, color wheels, loading rings
RepeatingThe pattern tilesStripes, checks, ruled lines

Gradient tips

  • Two colors with similar brightness look smooth. Colors far apart in brightness can show a muddy middle, which an extra stop can fix.
  • Put two stops at the same position for a hard edge instead of a blend, as in stripes.
  • Keep text readable on top. Check the contrast against the lightest and darkest part of the gradient with the color converter.
  • Subtle gradients, a few shades apart, look more professional than rainbow ones.

Box shadows

A shadow has an offset across and down, a blur, a spread and a color with opacity. You can stack up to five layers, which is the trick behind natural-looking shadows. Real light makes a tight dark shadow near the object and a large faint one further away, so two layers beat one heavy one:

box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 8px 24px -4px rgba(0,0,0,.15);

What spread does

Spread makes the shadow bigger or smaller before it's blurred. A negative spread with a large blur gives a soft shadow that sits mostly under the element and doesn't stick out at the sides. That's the look of a card floating just above a page. An inset shadow goes inside the box, which suits pressed buttons and text fields.

EffectOffsetBlurSpreadOpacity
Subtle card0 / 1px2 to 3px010%
Raised card0 / 8px24px-4px15%
Popup or modal0 / 20px40px-8px25%
Pressed button0 / 2px inset4px020%

Support and performance

Gradients and shadows work in every modern browser, including phones. Large blurred shadows on many elements, or on things that move, can slow a page down on weak devices, so use them with a little restraint. A gradient is also a lightweight alternative to an image, since it's drawn from a few numbers and not downloaded.

Everything runs in your browser. When the CSS is done, shrink it with the CSS minifier, and size text and spacing with the px to rem converter.

Written by Akinrinmade Michael · Updated October 24, 2026

How to use

  1. 1Choose Gradient or Box shadow.
  2. 2Adjust the controls and watch the live preview.
  3. 3Add color stops or shadow layers if you want more depth.
  4. 4Click Copy CSS and paste it into your stylesheet.

Frequently asked questions

Which gradient types are supported?

Linear, radial and conic, each with an optional repeating version. You can use between 2 and 6 color stops.

Can I stack several shadows?

Yes. Add up to five layers. Layered, softer shadows often look more natural than one heavy shadow.

What does spread do in a box shadow?

Spread grows or shrinks the shadow before it is blurred. A negative spread with a large blur gives a soft shadow that stays under the element.

Do these work in all browsers?

Gradients and box-shadow are supported in every modern browser, including mobile.

Read the guide

Learn how this works and how to get the most from it.

Web & SEO

px vs rem vs em: Which CSS Unit Should You Use?

The difference between px, rem and em in CSS, how to convert between them, and when each one is the right choice.

3 min read

Color Converter & Contrast Checker

Convert HEX, RGB and HSL and check WCAG contrast ratios.

CSS Minifier & Beautifier

Compress CSS to save bytes, or format it so it is easy to read.

PX to REM Converter

Convert px to rem, em, pt and percent for any base font size.

QR Code Generator

QR codes for links, Wi-Fi, contacts, email, phone and text. PNG or SVG.