Posted 11 years ago
·
Author
This is a short tutorial on Selector Grouping. Selector Grouping is the process in which you assigned multiple Selectors to a Declaration block. Selector Grouping is very useful for cleaning up your code, making it easier to work with and making it easier for other people to read/understand.
Selector Grouping allows you to use the same block of css code on multiple selectors saving you from having to re write that block of css code over an over again. So if you find that multiple parts of your web page share the same code, Selector Grouping is something to look into.
To group multiple selectors together, separate them with commas before the declaration block.
Below is an example of Selector Grouping:
The above code does the exact same thing as this:
As you can see, the code with Selector Grouping applied is much smaller and simpler to read and work with. Selector Grouping is just one of the many practices a good coder will learn.
Selector Grouping allows you to use the same block of css code on multiple selectors saving you from having to re write that block of css code over an over again. So if you find that multiple parts of your web page share the same code, Selector Grouping is something to look into.
To group multiple selectors together, separate them with commas before the declaration block.
Below is an example of Selector Grouping:
The above code does the exact same thing as this:
As you can see, the code with Selector Grouping applied is much smaller and simpler to read and work with. Selector Grouping is just one of the many practices a good coder will learn.