Display Detective — CSS

Find the right display value: 18 cases of block, inline, inline-block and flex. The most effective CSS display game for understanding browser flow.

What you learn in this game

HTML elements have a default display value. Block elements (like <div>, <p>, <li>) take up a full line. Inline elements (like <span>, <a>) are only as wide as their content. If the display is wrong, the layout can break.

Sometimes you need an element that lines up horizontally (like inline) but can also be sized (like block). That's what inline-block is for: it combines the two.

Sometimes you need to hide an element from the page. display:none removes the element completely from the layout: it's invisible and takes no space. That's different from visibility:hidden, which hides it but still takes up space.