Writing Efficient CSS

A topic I’ve been delving into lately is writing efficient CSS. Using shorthands, inheritances, and so on, I was able to streamline my CSS file from 7.8KB to 7KB. That’s a shaving of 800bytes, and while it won’t be noticable, it’ll certainly help. With sites that are getting larger and larger, this kind of knowledge can really help save bandwidth in the long run. CommunityMX has an article on how to write efficient CSS, and I’m intend to learn some things I probably didn’t know before.

One of the touted benefits of CSS is that it reduces total page weight, and thus download time, both at first page load, and even more on subsequent loads due to style sheet caching. This is true, but often a sizable fraction of the first load savings is lost because of highly redundant CSS code.
Well that’s all over. Now you will learn some “secrets” of efficient CSS coding, enabling you to pare that style sheet right down to the bare bones. To be sure, you won’t achieve huge savings doing this, but for some highly competitive sites every little bit counts.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>