ควิซ HTML & CSS: display & position

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.

ปานกลาง 10 ข้อ ~6 นาที ผ่านที่ 80%

เลือกโหมด

กำลังเล่นแบบผู้เยี่ยมชม: เข้าสู่ระบบเพื่อเก็บ XP และ streak

ตัวอย่างคำถาม

ข้อ 1 จาก 10

How wide is the <span>?

<style>
  span { width: 300px; height: 100px; background: gold; }
</style>
<p>Some <span>short</span> text.</p>
ดูเฉลย

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.

ควิซนี้มีเนื้อหาอะไรบ้าง

  • 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

คำถามที่พบบ่อย

ต้องมีบัญชีไหม?

ไม่ต้อง ใครก็เล่นได้ เข้าสู่ระบบเพื่อเก็บ XP, streak, เหรียญตรา และประวัติ

ทำซ้ำได้ไหม?

ได้ ระบบเก็บคะแนนที่ดีที่สุดไว้ และสลับคำถามกับตัวเลือกใหม่ทุกครั้ง