CSS Group Selector

Last Updated Jul 21, 2015, 12:00:06 PM





CSS Group Selector

CSS group selector is used to group the list of elements and apply them the same style.

For example, you have one h2 and one p, and other tag. What you do is, just keep all the ids in one line seperated by a comma and apply the same style, like second example below

Before Grouping
After Grouping

Grouping mainly reduces the no of lines of code we need to write.


Watch GIF Try It Now

CSS Selectors Reference

CSS Selectors Reference

CSS Combinators

Other CSS Selectors you might want to learn

CSS Class Selector

CSS Group Selector

CSS Child Combinator

CSS General Combinator

CSS Adjacent Combinator



Sources and Credits

The source of the content has been referred and updated with Mozilla Foundation and W3C Organization

Last Updated Jul 21, 2015, 12:00:06 PM