Author:

Tony White runs the one-man show Ask the CSS Guy, an after-hours blog devoted to peeking under the hood of CSS and JavaScript web-design techniques, as well as troubleshooting CSS-related problems. He resides in Memphis, Tennessee.

Twitter: Follow Tony White on Twitter

7 Principles Of Clean And Optimized CSS Code

Some of you may remember the days when 30KB was the recommended maximum size of a web page, a value which included HTML, CSS, JavaScript, Flash, and images. I find with every new project with even the slightest bit of complexity, it's not long before that 30 KB ideal is well out of my reach. With the popularity of CSS layouts and JavaScript-enriched web page experiences, it's not uncommon, particularly for large sites, for the CSS files alone to jump well beyond that 30KB ceiling.

Doug Bowman's stopdesign.com CSS reveals specially crafted selectors used for layout

But there are some principles to consider during and after you write your CSS to help keep it tight and optimized. Optimization isn't just minimizing file size — it's also about being organized, clutter-free, and efficient. You'll find that the more knowledge you have about optimal CSS practices, smaller file size will inevitably come as an direct result of their implementation. You may already be familiar with some of the principles mentioned below, but they are worth a review. Being familiar with this concepts will help you write optimized CSS code and make you a better all-around web designer.

Read more...

↑ Back to top