CSS Selector Specificity
Multiple Choice Medium
Question
Which selector has the highest specificity?
Hint
IDs are more specific than classes, which are more specific than elements.
Explanation
ID selectors (#id) have a specificity of 1-0-0, class selectors (.class) are 0-1-0, element selectors are 0-0-1, and attribute selectors are 0-1-0. So #submit-btn wins with the highest specificity.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.