Offset
Moves the shadow horizontally and vertically.
Shadows create depth, elevation and focus. A good shadow is usually felt more than noticed.
.card {
box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
Typography & Visual Style
box-shadow can draw shadow outside or inside an element. It uses horizontal offset, vertical offset, blur, spread and color.
Shadows help separate surfaces, show elevation and create focus. But heavy shadows everywhere make a design feel cheap and inconsistent.
Professional CSS often uses a small elevation scale: low, medium and high shadows with consistent color and softness.
Moves the shadow horizontally and vertically.
Controls softness. Larger blur creates gentler depth.
Expands or contracts the shadow shape.
Transparent shadow color usually feels more realistic.
Visual model
Typography and visual style are where CSS starts to feel like design. These models turn subjective choices into reusable decisions you can explain, test and improve.
Examples
:root {
--shadow-low: 0 10px 30px rgba(0, 0, 0, .18);
--shadow-high: 0 30px 90px rgba(0, 0, 0, .34);
}
.card {
box-shadow: 12px 12px 0 black;
}
* { text-shadow: 2px 2px 4px red; }
Rules that matter
A beautiful one-off style is not enough. The goal is a visual system that keeps working when the site grows, content changes and new pages are added.
A shadow should communicate layer position.
Large blur and transparent color often feel more natural.
Three shadow levels are easier to manage than dozens.
Fix contrast instead of blurring text.
Dark surfaces may need highlights or borders more than black shadows.
Too many elevated surfaces flatten the hierarchy.
Production thinking
Shadows help users understand what is in front, what is clickable and what deserves attention.
Do not use shadows as the only focus indicator. Focus needs a clear visible state.
Define shadows as tokens and use them consistently across cards, menus and modals.
Visual clarity supports user trust and interaction, especially on conversion pages.
Live code lab
The preview runs in an isolated iframe. Links and forms stay inside the practice area, so you can experiment without leaving the lesson.
Mini assignment
Practice assignment
Try it yourself
Self-check
Answer these questions before moving on. If your answer is vague, change the lab values and judge the visual result again.
Senior audit upgrade
Shadows create depth, but large blur effects on many moving elements can hurt rendering performance.
Use a small set of shadow tokens instead of random shadow values.
Avoid animating large shadows on many elements. Transform opacity-based layers instead when possible.
A premium interface usually uses less shadow, not more.