CSS Box Shadow Generator
Free online CSS box-shadow generator. Visually create beautiful shadows with adjustable offset, blur, spread, color and inset. Live preview and instant code copy.
What is CSS box-shadow?
CSS box-shadow is a CSS property that adds shadow effects around an element's frame. It allows you to create drop shadows, inner shadows, and multiple shadow layers by specifying offset, blur radius, spread radius, and color values.
What are the parameters of box-shadow?
The box-shadow property accepts several values: horizontal offset (X), vertical offset (Y), blur radius, spread radius, color, and the optional inset keyword. You can also specify multiple shadows separated by commas.
What is the inset keyword?
The inset keyword changes the shadow from an outer shadow (drop shadow) to an inner shadow. When inset is specified, the shadow is drawn inside the element's border instead of outside, creating an inset effect.
What is blur radius?
Blur radius determines how much the shadow's edge is blurred. A value of 0 creates a sharp, solid edge. Larger values create a more diffused, softer shadow that extends further from the element.
What is spread radius?
Spread radius expands or contracts the shadow size. Positive values make the shadow larger than the element, while negative values make it smaller. This affects the shadow before the blur is applied.
How do I create multiple shadows?
You can create multiple shadows by separating each shadow definition with a comma. Each shadow can have different offset, blur, spread, and color values. Shadows are applied in the order they are declared, with the first shadow on top.
Can I use RGBA colors for shadows?
Yes, you can use any CSS color format including RGBA, HSLA, HEX, or named colors. RGBA and HSLA are particularly useful for creating semi-transparent shadows that blend naturally with backgrounds.
How do I copy the generated CSS code?
Simply click the "Copy Code" button in the generator interface. The CSS code will be copied to your clipboard and can be pasted directly into your stylesheet or HTML file.
Is box-shadow supported in all browsers?
Yes, box-shadow is supported in all modern browsers including Chrome, Firefox, Safari, Edge, and Opera. It has been part of CSS3 since 2011 and has excellent browser compatibility.
Does box-shadow affect performance?
Box-shadow has minimal performance impact on modern browsers. However, using multiple complex shadows with large blur radius on many elements can impact rendering performance, especially on mobile devices.
What are common use cases for box-shadow?
Common uses include creating card elevation effects, adding depth to buttons, creating inset form fields, implementing material design shadows, and adding visual separation between overlapping elements.
Can I animate box-shadow?
Yes, box-shadow can be animated using CSS transitions or animations. However, animating box-shadow can be performance-intensive. For better performance, consider using pseudo-elements with opacity transitions instead.