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.

Trung bình 10 câu hỏi ~6 phút Đạt từ 80%

Chọn chế độ

Bạn đang chơi với tư cách khách: đăng nhập để lưu XP và streak.

Câu hỏi mẫu

Câu 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;
}
Xem đáp án

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.

Quiz này có gì

  • 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

Câu hỏi thường gặp

Có cần tài khoản không?

Không. Ai cũng chơi được. Đăng nhập để lưu XP, streak, badge và lịch sử.

Có làm lại được không?

Được. Điểm cao nhất của bạn được giữ lại, câu hỏi và đáp án được xáo trộn mỗi lần.