Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 30, 2019 10:58 pm GMT

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:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks