CSS basics: Background surfaces
A background should keep foreground content readable rather than carry meaning alone.
Current edit
Understand the pattern
A background should keep foreground content readable rather than carry meaning alone.
A background should keep foreground content readable rather than carry meaning alone.
Misconceptions to reject
- If the page fits one desktop viewport, no narrower viewport needs checking.
- Hiding all overflow always makes content accessible.
The preview is a sanitized subset, not a full browser compatibility test.
Worked example and expected result
main { background-color: #f4f7f5; }
main { color: #182b2a; }
.notice { background-color: #ffffff; }A background should keep foreground content readable rather than carry meaning alone.
Explain it
Apply it elsewhere
Keep the momentum.
Complete the lab, then explain and apply the pattern.
Next: CSS basics: Reusable utility classesTry an incident drillAnonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.
Keep learning
- 01CSS basics: BordersA visible border needs a style as well as a width and color; it participates in box sizing.Practice
- 02CSS basics: Reusable utility classesSmall utility classes should have a predictable job and avoid accidental changes to unrelated components.Practice
- 03CSS basics: Hover statesHover is one interaction state, not the only indication that a control can be used.Practice