About This Tool
NinjaFunction's CSS Box Shadow Generator lets you design a shadow by moving sliders for offset, blur, spread and opacity, and see the result on a live preview box. Add up to five layers, switch to an inset shadow, start from ready presets such as Soft, Layered or Glow, change the box and page colours, and copy the finished CSS in one click. It runs in your browser, so nothing is sent to a server.
Frequently Asked Questions
How do I add a shadow to an element in CSS?
Use the box-shadow property, for example box-shadow: 0px 10px 25px 0px rgba(10, 43, 39, 0.2);. The numbers are the horizontal offset, the vertical offset, the blur, the spread and the colour. Copy the code from this tool and paste it into your style.
Can I use more than one shadow?
Yes. Separate the shadows with commas, and the first one sits on top. This tool lets you add up to five layers and writes the code for you. Layered shadows look softer and more natural than one big shadow.
What does an inset shadow do?
An inset shadow is drawn inside the box instead of outside it. It makes the box look pressed in, and it is often used on input fields and pressed buttons.
What is the difference between blur and spread?
Blur makes the edge of the shadow soft. Spread makes the whole shadow bigger, or smaller if the number is negative, before the blur is applied.
What is the difference between box-shadow and drop-shadow?
box-shadow follows the rectangle of the element, including its rounded corners. The drop-shadow filter follows the real outline of the content, so it also works on transparent images and shapes.
Do box shadows slow down my page?
A few shadows cost almost nothing. Very large blurs on many elements, or on elements that move, can slow older phones, so keep blur values reasonable and avoid animating shadows on long lists.
Does it work in every browser?
Yes. The box-shadow property works in all current browsers, and the code from this tool needs no prefixes.