ควิซ HTML & CSS: Pseudo-classes & Pseudo-elements

This CSS quiz tests pseudo-classes like :first-child, :nth-child(), :not() and :where(), and pseudo-elements like ::before, ::placeholder and ::marker. You will read short snippets and decide which elements match, which rule wins and why some generated content never shows up.

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

เลือกโหมด

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

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

ข้อ 1 จาก 10

Which paragraphs turn red?

<style>
  p:first-child { color: red; }
</style>
<div>
  <h2>Title</h2>
  <p>One</p>
  <p>Two</p>
</div>
ดูเฉลย

C. Neither paragraph p:first-child means a p that is the first child of its parent. Here the first child is the h2, so no paragraph matches. p:first-of-type would select "One".

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

  • :first-child vs :first-of-type and :nth-child() formulas
  • ::before / ::after and the content property
  • Specificity of :not(), :is() and :where()
  • Link and focus states: :hover, :focus-visible
  • Styling parts of elements: ::placeholder, ::marker

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

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

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

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

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