CSS Interview Questions

This CSS quiz covers the questions you are most likely to hear in a front-end interview: the box model, specificity, positioning, em vs rem, hiding elements and the cascade keywords. Small snippets let you prove the answer instead of guessing.

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

เลือกโหมด

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

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

ข้อ 1 จาก 10

With the default box-sizing: content-box, how wide is this box on screen (border included)?

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

D. 250px With content-box, width is only the content: 200 + 20 * 2 padding + 5 * 2 border = 250px. With box-sizing: border-box the box would be exactly 200px.

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

  • The box model and box-sizing
  • Specificity, !important and initial
  • Positioning, z-index and margin collapsing
  • em vs rem calculations
  • Hiding elements: display, visibility, opacity

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

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

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

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

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