Skip to content

Showing and hiding (display)

Handout

How boxes flow

  • Some elements are block: they stack on top of each other and fill the width — <div>, <p>, <h1>.
  • Some are inline: they sit side by side, taking only as much room as they need — <span>, <a>, <strong>.
  • display lets you change which way an element behaves.

Block elements stack on their own lines, inline elements sit side by side, none hides

Handout

Log in or create account

IGCSE & A-Level