top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is Grouping?

0 votes
198 views
What is Grouping?
posted Aug 29, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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. This tip combines Group Selectors with Group Declarations into one powerful technique.

So this:

body {font-size: 12px; }
body {font-family: arial, helvetica, sans-serif;}
th {font-size: 12px; font-family: arial, helvetica, sans-serif;}
td {font-size: 12px; font-family: arial, helvetica, sans-serif;}

Becomes this:

body, th, td {font-size: 12px; font-family: arial, helvetica, sans-serif;}

Even better, use shorthand properties to create an optimized CSS rule:

body,th,td{font:12px arial,helvetica,sans-serif;}
answer Aug 30, 2014 by Amit Kumar Pandey
...