What is grouping?

What is grouping?

Senior Developer Asked on June 3, 2018 in CSS.
Add Comment
1 Answer(s)

CSS grouping can be used to condense code that has multiple selectors with the same declarations. This makes code easy to read and maintain. Also it is significantly reduced development time as there is less code to write.The Page loading times is reduced if we’ll use grouping in CSS.
Code Without Grouping:


h1{

font-size: 5px;

color: red;

}

h2{

font-size: 5px;

color: red;

}

h3{

font-size: 5px;

color: red;

}

Code With Grouping:


h1, h2, h3 {

font-size: 5px;

color: red;

}

Default Answered on December 4, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.