FSM Full Stack Masterclass
Platform under construction
CSS course badge

Typography & Visual Style

Intermediate

Shadows

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

Shadows should explain depth, not decorate every box.

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.

Offset

Moves the shadow horizontally and vertically.

Blur

Controls softness. Larger blur creates gentler depth.

Spread

Expands or contracts the shadow shape.

Color alpha

Transparent shadow color usually feels more realistic.

Visual model

Make visual decisions systematic instead of random.

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.

Low

Small lift for cards and controls.

Medium

Panels, dropdowns and active surfaces.

High

Modals or focused foreground layers.

Examples

High-end visual CSS has a reason behind every value.

Soft elevation scale

:root {
  --shadow-low: 0 10px 30px rgba(0, 0, 0, .18);
  --shadow-high: 0 30px 90px rgba(0, 0, 0, .34);
}

Hard noisy shadow

.card {
  box-shadow: 12px 12px 0 black;
}

* { text-shadow: 2px 2px 4px red; }

Rules that matter

Visual style becomes professional when it becomes repeatable.

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.

Use shadows for elevation

A shadow should communicate layer position.

Keep shadows soft

Large blur and transparent color often feel more natural.

Use a small scale

Three shadow levels are easier to manage than dozens.

Avoid text shadows for readability fixes

Fix contrast instead of blurring text.

Respect dark themes

Dark surfaces may need highlights or borders more than black shadows.

Do not shadow everything

Too many elevated surfaces flatten the hierarchy.

Production thinking

Visual polish must survive real content, real users and real devices.

Why does this matter?

Shadows help users understand what is in front, what is clickable and what deserves attention.

Accessibility

Do not use shadows as the only focus indicator. Focus needs a clear visible state.

Production note

Define shadows as tokens and use them consistently across cards, menus and modals.

SEO note

Visual clarity supports user trust and interaction, especially on conversion pages.

Live code lab

Change the CSS and watch the interface respond.

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

Try this now.

  • Set blur to 0 and compare how harsh the cards feel.
  • Increase alpha to .8 and decide if it looks realistic.
  • Remove shadows and use borders only.

Practice assignment

Do this before moving to the next lesson.

  1. Create low, medium and high shadow tokens.
  2. Apply them to three surfaces.
  3. Explain when each elevation level should be used.

Try it yourself

Create a simple elevation system

Live preview

Self-check

Before you continue, prove that you understand Shadows.

Intermediate

Answer these questions before moving on. If your answer is vague, change the lab values and judge the visual result again.

  1. Can you name the parts of box-shadow?
  2. Can you create soft depth without heavy black shadows?
  3. Can you avoid shadowing every component?
  4. Can you choose borders over shadows in dark UI when needed?
  5. Can you keep focus states visible without relying only on shadow?

Senior audit upgrade

Heavy shadows can be expensive.

Shadows create depth, but large blur effects on many moving elements can hurt rendering performance.

Elevation scale

Use a small set of shadow tokens instead of random shadow values.

Performance

Avoid animating large shadows on many elements. Transform opacity-based layers instead when possible.

Subtlety

A premium interface usually uses less shadow, not more.