Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialvamosrope14
14,932 PointsDo media queries have the greatest specificity on a CSS stylesheet?
.
3 Answers
Steven Parker
231,271 PointsMedia queries are customarily located last in the CSS, so the rules in them override any rules above them with the same specificity because of source order.
The media query itself doesn't have a specificity, but the rules inside it each have their own.
vamosrope14
14,932 Points.
Steven Parker
231,271 PointsI amended my answer to clarify that the rules have the specificity, which is based on their selectors.
vamosrope14
14,932 Points.
Steven Parker
231,271 PointsThat's why I said the rules in the media query "override any rules above them with the same specificity".