An Interest In:
Web News this Week
- April 29, 2024
- April 28, 2024
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
July 30, 2019 10:58 pm GMT
Original Link: https://css-tricks.com/how-much-specificity-do-rules-have-like-keyframes-and-media/
How much specificity do @rules have, like @keyframes and @media?
I got this question the other day. My first thought is: weird question! Specificity is about selectors, and at-rules are not selectors, so... irrelevant?
To prove that, we can use the same selector inside and outside of an at-rule and see if it seems to affect specificity.
body { background: red;}@media (min-width: 1px) { body { background: black; }}
The background is black. But... is that because the media query increases the specificity? Let's switch them around.… Read article
The post How much specificity do @rules have, like @keyframes and @media? appeared first on CSS-Tricks.
Original Link: https://css-tricks.com/how-much-specificity-do-rules-have-like-keyframes-and-media/
Share this article:
Tweet
View Full Article