Today, I visited one of the blogs of Google Code speed and read the post entitled CSS: Using every declaration just once. It has caught my attention because according to author Jens Meiert, Google Webmaster, declaring your properties for your selector once will reduce its file size for about 20-40%. With smaller file size of your CSS that means your server will not consume more bandwidth loading it.

How does it work? Here's sample from

Assuming we have the following selectors and properties.

h1 { color: black; }
p { color: black; }

This can be optimized like this.

h1, p {color: black; }

This is applicable to theme developers who separate their CSS typography, layout, color schemes and etc or anyone who would like to reduce their CSS file size.

Very easy isn't it? I will be applying this too.

0 comments:

Post a Comment

Thank you for commenting into this post. I will have it published if it isn't spam