Chapter

Styling and layout

<p>Connect a stylesheet, understand the cascade, and create layouts that adapt rather than overflow.</p>

Lessons

  1. CSS selectors and the cascade

    Select elements with type, class, and ID selectors and reason about competing declarations.

  2. The box model and spacing

    Use content, padding, border, and margin to reason about element size and spacing.

  3. Typography, color, and readable contrast

    Choose readable fonts, line lengths, and color combinations for a comfortable page.

  4. Flexbox and grid layouts

    Choose Flexbox for one-dimensional alignment and Grid for two-dimensional page layouts.