The CSS box-shadow property adds depth to flat elements: a card that seems to float, a button that looks pressable, an input that appears recessed. One line of CSS replaces what used to need image files and extra markup.
The catch is that its five numbers interact in ways that are hard to picture. The Box Shadow Generator on BISCS India solves that with sliders and a live preview. Adjust offset, blur, spread, colour and opacity, stack several layers, and copy the CSS once it looks right.
The anatomy of a box-shadow
Here is a typical soft card shadow:
box-shadow: 0px 10px 30px -5px rgba(0, 0, 0, 0.18);
Reading it left to right:
| Value | Name | What it does |
|---|---|---|
0px |
X offset | Moves the shadow right (positive) or left (negative) |
10px |
Y offset | Moves it down (positive) or up (negative) |
30px |
Blur | Softens the edge; 0 is a hard edge |
-5px |
Spread | Grows (positive) or shrinks (negative) the shadow |
rgba(0, 0, 0, 0.18) |
Colour | Usually black or a dark tint at low opacity |
Add the keyword inset at the start and the shadow is drawn inside the element instead, making it look pressed in.
How to build a shadow with BISCS India
- Open the Box Shadow Generator.
- Click a preset to start: Soft, Medium, Large, Hard, Glow, Layered, Neumorphic or Inset.
- Fine-tune with the sliders or number fields: X offset and Y offset (−100 to 100 px), Blur (0 to 200 px), Spread (−100 to 100 px) and Opacity (0 to 1).
- Pick a shadow Colour and tick Inset if you want an inner shadow.
- Match the preview to your design by setting the Corner radius, Box colour and Background. A shadow that looks good on white can look heavy on a grey page.
- Click Add layer to stack another shadow (up to eight). Select a layer chip to edit it, or Remove layer to delete it.
- Click Copy CSS.
Why negative spread makes shadows look natural
Beginners often crank up the blur and wonder why the shadow looks like a grey cloud around the whole card. In real life, an object lifted off a surface casts a shadow mostly beneath it, not around its sides.
A negative spread shrinks the shadow before it is blurred, so it hides behind the element at the sides and peeks out mainly at the bottom, thanks to the positive Y offset. Compare:
/* Muddy halo */
box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
/* Lifted card */
box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.18);
Layered shadows for realistic depth
Real shadows have a sharp, dark core close to the object and a wide, faint area further away. A single CSS shadow cannot do both, but several stacked shadows can. The Layered preset uses five shadows that double in size each time:
box-shadow:
0 1px 1px rgba(0, 0, 0, 0.08),
0 2px 2px rgba(0, 0, 0, 0.08),
0 4px 4px rgba(0, 0, 0, 0.08),
0 8px 8px rgba(0, 0, 0, 0.08),
0 16px 16px rgba(0, 0, 0, 0.08);
Each layer is very light on its own; together they produce a smooth, believable falloff. This approach is popular in modern design systems because it looks good on any background.
Shadow styles and when to use them
- Soft: cards, modals and dropdown menus on light backgrounds.
- Medium: small UI elements like buttons and chips that need a gentle lift.
- Large: pop-ups and dialogs that should feel clearly above the page.
- Hard: zero blur and an offset, giving a flat, retro or "neo-brutalist" look.
- Glow: a coloured shadow with no offset, useful for focus states or highlighting a primary call to action.
- Neumorphic: a light shadow on one side and a dark one on the other, so the element seems extruded from the background. It only works when the element and background are the same colour, and it often has poor contrast, so use it sparingly.
- Inset: input fields, toggles and pressed button states.
Design tips
- Keep one light source. If shadows on your page point down, all of them should. Mixed directions look odd.
- Use elevation levels. Define three or four shadows, for example resting, raised, floating and modal, and reuse them across the site instead of inventing new ones.
- Tint shadows on coloured backgrounds. On a blue background, a dark blue shadow looks richer than pure black.
- Respect dark mode. Shadows are barely visible on dark backgrounds. Many dark themes use lighter surface colours or subtle borders to show depth instead.
- Do not rely on shadows alone. An outline or slight background difference helps people with low vision tell where a card begins.
Common mistakes
- Opacity too high. A shadow at 0.5 or more looks heavy and dated. Most interface shadows sit between 0.05 and 0.25.
- Forgetting
border-radius. The shadow follows the element’s corners. If the card is rounded but the shadow preview was square, the result will not match. Set the same radius in the generator. - Shadows cut off. A parent with
overflow: hiddenclips child shadows. Add padding to the parent or move the overflow rule. - Animating
box-shadowdirectly. It can be janky on slower phones. Animate the opacity of a pseudo-element that carries the shadow instead. - Using shadows as borders.
0 0 0 1pxis a neat trick for a border that does not affect layout, but a realborderoroutlineis clearer for accessibility tools.
Pair it with other CSS tools
Shadows look best with a thoughtful background. Try a subtle gradient from the CSS Gradient Generator behind a white card, and choose a shadow tint that matches your palette using the Color Converter.
Privacy
The preview is rendered by your browser and the CSS is generated on the page. Nothing is uploaded or saved, and there is no sign-up or watermark.