ควิซ HTML & CSS: The Box Model

This CSS quiz makes you do the math the browser does for every box. You will compute rendered widths with box-sizing: content-box and border-box, resolve percentage padding, and predict when vertical margins collapse.

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

เลือกโหมด

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

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

ข้อ 1 จาก 10

How wide is the box on screen, from its left border edge to its right border edge?

.box {
  width: 200px;
  padding: 20px;
  border: 5px solid black;
  margin: 10px;
}
ดูเฉลย

B. 250px The default box-sizing: content-box applies width to the content only: 200 + 20 + 20 + 5 + 5 = 250px. Margin is outside the border, so it adds space around the box but not to its border-box width.

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

  • Content, padding, border and margin
  • box-sizing: content-box vs border-box
  • Percentage padding and margin
  • Vertical margin collapsing between siblings and with parents
  • Centering a block with margin: 0 auto

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

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

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

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

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