DEV Community

TimothyAgevi
TimothyAgevi

Posted on

 

Grouping in CSS

h2 {
    color: red;
}

.thisOtherClass {
    color: red;
}

.yetAnotherClass {
    color: red;
} 
Enter fullscreen mode Exit fullscreen mode
  • In Grouping we separate selectors with commas (,) Alternative of the above 10 lines of code is as shown below:
h2, .thisOtherClass, .yetAnotherClass {
    color: red;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Advice For Junior Developers

Advice from a career of 15+ years for new and beginner developers just getting started on their journey.