liveBook · Manning

Box-shadow

As explained in Build a Website with ChatGPT

box-shadow is a CSS property that renders one or more shadows around an element's box.

box-shadow is a CSS property that adds one or more shadows around an element’s box. A shadow can make a card appear slightly raised from the page. section 11.2.3 section 11.6

Adjust the shadow by changing these values:

  • x-offset shifts the shadow right with a positive value or left with a negative value. section 11.2.3
  • y-offset shifts the shadow down with a positive value or up with a negative value. section 11.2.3
  • blur controls softness: 0 produces no blur, while larger values make the shadow progressively softer. section 11.2.3
  • rgba alpha controls transparency from 0, completely transparent, to 1, completely opaque. section 11.2.3
  • An optional spread value changes the shadow’s size relative to the element. section 11.2.3

A card shadow

Add this declaration to a card rule: box-shadow: 8px 8px 4px rgba(0, 0, 0, 0.5); The shadow moves 8 pixels right and down, uses a 4-pixel blur, and is half transparent. If the effect is not wanted, remove the box-shadow declaration or ask ChatGPT not to add a drop-shadow. section 11.2.3 section 11.5

box-shadow: 8px 8px 4px rgba(0, 0, 0, 0.5);

Inspect a copyable box-shadow declaration using explicit offsets, blur, and transparency. section 11.2.3

How Build a Website with ChatGPT covers it

How deep it goes
Explains the declaration’s offsets, blur, transparency, and optional spread, but stops short of advanced shadow composition.
Examples
Uses portfolio cards, an 8px-by-8px shadow, 4px blur, and rgba transparency as concrete examples.
What it assumes
Assumes basic HTML and CSS editing while explaining shadow terminology and values directly.
What you can do after
Apply it via CSS to add, tune, or remove shadows from cards and other block-level elements.
How it connects
Connects box-shadow with CSS cards, border, border-radius, and rgba color values.

Also explained in

Compare how 3 books explain box-shadow →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Website with ChatGPT. The section links point to the parts of the book it draws on.