Question 4 of 10Pro Only

Explain CSS specificity. How does the browser determine which styles to apply when multiple rules target the same element?

Sample answer preview

CSS specificity is the system browsers use to determine which styles take precedence when multiple rules could apply to the same element. Understanding specificity helps you write predictable CSS and debug styling issues.

specificitycascadeselectorsIDclasselement

Unlock the full answer

Get the complete model answer, key points, common pitfalls, and access to 9+ more Frontend Developer interview questions.

Upgrade to Pro

Starting at $19/month • Cancel anytime