📐 CSS Box Shadow Generator
Design custom box shadows and generate the CSS code instantly.
Mastering the CSS Box Shadow Property
The box-shadow property is one of the most powerful tools in a web designer’s arsenal. When used correctly, it adds physical depth, realism, and a modern “card” aesthetic to standard HTML blocks. Our Box Shadow Generator visually handles the complex syntax, allowing you to instantly export cross-browser compatible CSS.
The Anatomy of a Box Shadow
A standard box-shadow declaration consists of five main values: box-shadow: x-offset y-offset blur spread color;
- X and Y Offsets: Determine the horizontal and vertical position of the shadow. Positive values push the shadow down and to the right.
- Blur Radius: Controls the softness of the shadow. A blur of 0px creates a harsh, solid block of color (often used in retro or brutalist web design), while a blur of 20px creates a soft, diffused glow.
- Spread Radius: Expands or shrinks the total size of the shadow.
- Inset: Adding the keyword
insetto the beginning of the rule moves the shadow inside the element, creating a sunken or “pressed” effect.
Creating Realistic Layered Shadows
A common mistake novice designers make is using a single, heavy black shadow, which looks artificial. In the real world, light diffuses over distance. To create a highly realistic, premium shadow, modern CSS techniques involve layering multiple shadows separated by commas. Our advanced generator allows you to easily stack a small, tight shadow with a large, diffuse shadow to achieve this exact high-end look.
