Intermediate
HTML & CSS
Q63 / 100
What is "CSS specificity" calculated from when comparing two selectors like "#nav .link" and ".container a"?
Correct! Well done.
Incorrect.
The correct answer is B) The number and type of selectors used (IDs, classes/attributes/pseudo-classes, and elements), where "#nav .link" (1 ID + 1 class) outranks ".container a" (1 class + 1 element)
B
Correct Answer
The number and type of selectors used (IDs, classes/attributes/pseudo-classes, and elements), where "#nav .link" (1 ID + 1 class) outranks ".container a" (1 class + 1 element)
Explanation
Specificity is computed by counting ID selectors, class/attribute/pseudo-class selectors, and element/pseudo-element selectors; a selector with an ID generally outranks one without, regardless of source order (unless !important or later equal-specificity rules apply).
Progress
63/100