QuizNot attempted
Specificity
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
- A
- Specificity is compared column by column as (ids, classes/attributes/pseudo-classes, elements), and A is the only selector with an id: A = (1,1,1), so it beats any number of classes.
- Not B (0,3,1): three class-level parts (
.nav,.item,:hover) still lose to one id. - Not C (0,0,4): four element selectors never outrank even one class.
- Not D (0,2,1): two classes on the
aare still zero ids. - Source order only decides an exact tie
- inline styles beat all selectors and
!importantbeats both.