HTML and CSS Reference
In-Depth Information
h2 {
color: red;
background: black;
}
Grouped selectors and declarations
Both the selectors and declarations can be combined, resulting in a single rule.
h1, h2 {
color: red;
background: black;
}
Rules should be grouped whenever possible to make the code more concise. It has
a performance benefit because concise rules reduce the size of the style sheet, which
makes the CSS file load more quickly. Moreover, it is convenient to specify the properties
in only one place, in case they have to be changed later. Additionally, grouping selectors
with similar styles makes it easier to maintain consistency between them.
 
Search WWH ::




Custom Search