How to Use the CSS Box Shadow Generator: Steps and a Worked Example
Generate a CSS box-shadow from offset, blur, spread and colour. This guide shows what to enter, a worked example, and the limits to keep in mind. The CSS Box Shadow Generator tool is free, needs no account and runs in your browser.
What you need
- Horizontal offset (px), for example 0
- Vertical offset (px), for example 4
- Blur radius (px), for example 12
- Spread (px), for example 0
- Shadow colour, for example rgba(0, 0, 0, 0.15)
Step by step
- Open the CSS Box Shadow Generator tool.
- Fill in Horizontal offset (px).
- Fill in Vertical offset (px).
- Fill in Blur radius (px).
- Fill in Spread (px).
- Fill in Shadow colour.
- Read the result, which updates as soon as the inputs change.
Worked example
With these inputs:
- Horizontal offset (px): 0
- Vertical offset (px): 4
- Blur radius (px): 12
- Spread (px): 0
- Shadow colour: rgba(0, 0, 0, 0.15)
the tool returns:
box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
A second example
Changing Horizontal offset (px) 0 to 10 gives:
box-shadow: 10px 4px 12px 0 rgba(0, 0, 0, 0.15);
Comparing two runs like this is a quick way to see how much each input moves the result.
How it works
Set the offsets, blur, spread and colour. Positive offsets move the shadow right and down.
Things to keep in mind
Check your inputs, units and any local rules before you rely on the result.
Related tools
If this is not quite what you need, try CSS Border Radius Generator, CSS Color Extractor or CSS Flexbox Generator.