HTML & CSS display & position Quiz

This CSS quiz checks how display and position shape the layout. You will predict which properties inline elements ignore, how display: none differs from visibility: hidden, and where relative, absolute, fixed and sticky elements are placed.

Medium 10 questions ~6 minutes Pass at 80%

Choose a mode

Playing as a guest: sign in to keep your XP and streak.

Sample question

Question 1 of 10

How wide is the <span>?

<style>
  span { width: 300px; height: 100px; background: gold; }
</style>
<p>Some <span>short</span> text.</p>
Show the answer

B. As wide as its text, because width and height do not apply to inline elements A <span> is display: inline by default, and non-replaced inline boxes ignore width and height. Use display: inline-block or block to size it.

What this quiz covers

  • block, inline and inline-block
  • display: none vs visibility: hidden
  • relative and absolute with the containing block
  • fixed and how transform changes it
  • sticky and why it sometimes does not stick

Questions people ask

Do I need an account?

No. Anyone can play. Sign in to keep your XP, streak, badges and history.

Can I retake it?

Yes. Your best score is kept, and the questions and answers are shuffled each time.