CSS – Group Selector

0
445
CSS Group Selector

By joining the grouping of selectors that offer a similar declaration and declarations that offer a similar selector you can apply numerous declarations to various selectors. This method enables you to make reduced yet capable CSS rules. This tip consolidates Group Selectors with Group Declarations into one effective method.

Example:
body {font-size: 16px; }
body {font-family: calibri, helvetica, sans-serif;}
th {font-size: 16px; font-family: calibri, helvetica, sans-serif;}
td {font-size: 16px; font-family: calibri, helvetica, sans-serif;}

Will Converted in:

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

For more optimization, utilize shorthand properties to make an improved CSS run the show

body,th,td{font:14px calibri,helvetica,sans-serif;}