When two CSS selectors go head to head, it's up to you to judge which one will win out! Keep ranking up as you learn all about CSS specificity, and you'll face tougher and tougher showdowns. By the final level, you'll be a true master.
Learning Objectives
Learn about how different types of CSS selectors affect specificity, including elements; classes; IDs; pseudoclasses such as :not()
and :hover()
; and pseudoelements such as ::before
and ::first-line
.
Learn the difference between the new pseudoclasses :is()
and :where()
when it comes to specificity.
Prerequisites
You should be familiar with the basics of CSS selectors. Play-through of CSS Scoops and Nth Cart first is recommended.