benjaminolsen.dev

Repair a cascade and width failure

The introduction disappears into its background, and the page is wider than a phone. There are competing .intro rules, a fixed content width and extra padding. Repair the causes without deleting content or hiding overflow.

Before starting: m3-build

Get started

  1. Open the page at a narrow width. Inspect the .intro declarations and the main box.
  2. Keep the text and image. Repair the conflicting colours and the width calculation.
  3. Test at 320px and 768px, read the longer introduction and run the checks.
Start in browser editorDownload starter filesOpen practice checks

Requirements

Manual checks

Hints

Hint 1

The last matching rule matters when specificity is equal. Width also includes more than content under content-box.

Hint 2

Compare the last .intro colour with its background. Then include padding and border when measuring main.

Hint 3

Remove the later white-on-white introduction rule or give it a dark foreground. Use border-box with width: 100% and max-width, and let main and paragraphs grow naturally.

Explain your decision

Why does overflow: hidden disguise this failure instead of repairing it?

Compare a practice solution after your attempt

This is one valid solution, not the only design. Compare the structure and behaviour rather than copying the appearance.

Download practice solution