CSS Grouping Selectors and Rules Within Same ID or Class
-
I am not very experienced with CSS, mostly self taught.
I’ve always written CSS like this…
#footer-sections p{font-weight: 400;}
#footer-sections a{font-weight: 700; text-decoration: none;}Recently I’ve seen others using CSS snippets that are structured like this…
#footer-sections {
p{font-weight: 400;}
a{font-weight: 700; text-decoration: none;}
}See how the other selectors and rules are combined within the same id, almost like a media query? It seems to work. Is this valid CSS? If so, what is this practice called so I can learn more about it?
Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘CSS Grouping Selectors and Rules Within Same ID or Class’ is closed to new replies.