What Is Grouping In CSS3?
What Is Grouping In CSS3?
Hello Friends,
A combinator is something that explains the relationship between the selectors. A CSS selector can contain more than one simple selector.
Grouping makes it possible to apply the same style to multiple HTML elements (Classes/Tag/ID) within a single declaration. It happens by specifying all the selectors separated by commas.
Collection in CSS is a strategy used to reduce rule redundancy and write clean, brief easy to understand rule. There are going to be many circumstances in which several CSS selectors will have the same conditions.
By combining the grouping of selectors that share the same declaration and declarations that share the same selector you can apply multiple declarations to multiple selectors. This technique allows you to create compact yet powerful CSS rules.
Grouping allows you to apply the same style to multiple elements(classes/tag/id) with a single declaration.
Grouping in CSS is a technique used to reduce code redundancy and write clean, concise easy to follow code. There are going to be many instances in which multiple CSS selectors will have the same declarations. In these cases, you can group all the selectors together and write the declarations only one time.
The CSS grouping selector is used to select multiple elements and style them together. This reduces the code and extra effort to declare common styles for each element. To group selectors, each selector is separated by a space.
The CSS Grouping Selector
The grouping selector selects all the HTML elements with the same style definitions. Look at the following CSS code (the h1, h2, and p elements have the same style definitions)
Grouping allows you to apply the same style to multiple elements(classes/tag/id) with a single declaration. This is done by listing all the selectors, separated by commas.
Example:
#maincontent p, ul { border-top: 1px solid #ddd; }
Oryon Networks | Singapore Web Hosting | Best web hosting provider | Best web hosting in SG | Oryon SG
The CSS grouping selector is used to select multiple elements and style them together. This reduces the code and extra effort to declare common styles for each element. To group selectors, each selector is separated by a space.
|
Bookmarks