Call (877) SITE-OPT (748-3678)

Code: Group Selectors with Common Declarations

From Chapter 7: CSS Optimization

CSS allows you to group multiple selectors that share the same declaration. This optimization technique allows you to apply the same style to multiple selectors, separated by commas, to save space.

So, instead of this:

.sitehead {
    font-weight: normal; font-size: 12px; color: #0b2475; font-family: arial,
    helvetica, sans-serif;
}
.sitenav {
    font-weight: normal; font-size: 12px; color: #0b2475; font-family: arial,
    helvetica, sans-serif;
}

do this, by grouping multiple selectors with common declarations:

.sitehead, .sitenav {
    font-weight: normal; font-size: 12px; color: #0b2475; font-family: arial,
    helvetica, sans-serif;
}

Even better, use the font shorthand property:

.sitehead, .sitenav {
    font: 12px arial,helvetica,sans-serif;color:#0b2475;
}
Copyright © 2002-2017 Website Optimization, LLC. All Rights Reserved - Free website speed test - Privacy Policy
Last modified: February 19, 2009.

Follow us on: Twitter, Google+, Facebook, Linked In