Grouping Complex Selectors in CSS
Let's say we have the following two selectors:
.block h2 {
color: red;
}
.block h3 {
color: red;
}
Since these selectors do the same thing, they can be grouped using commas:
.block h2, .block h3 {
color: red;
}
Simplify your code by using selector grouping:
#block h1 {
text-align: center;
}
#block h2 {
text-align: center;
}
Simplify your code by using selector grouping:
#block h1 {
text-align: center;
font-size: 30px;
}
#block h2 {
text-align: center;
font-size: 20px;
}