Skip to content


CSS Formatter and Optimiser

CleanCSS is a powerful CSS optimizer and formatter. Basically, it takes your CSS code and makes it cleaner and more concise. For optimization CleanCSS is using CSSTidy - an opensource CSS parser and optimiser.

Why optimise

CSS Optimiser reduces the size of CSS file more than 30% depending on various conditions, it causes faster loading pages and lower traffic costs.

How optimization works

  • Convert Values of CSS property into shorthand notations,
    e.g margin:1px 1px 1px 1px; becomes margin:1px;
  • All unnecessary whitespace is removed
  • Comments are removed
  • The last semicolon in every block can be removed
  • All duplicate properties are merged,
    e.g h1,h2,h3{color:##FF0000}
  • colors like “black” or rgb(0,0,0) are converted to #000000 or rather #000 if possible. Some hex-codes are replaced by their color names if they are shorter.
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • StumbleUpon
  • Twitter
  • Yahoo! Buzz

Posted in Html & CSS.

Tagged with .


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Continuing the Discussion

  1. CSS Shorthand Guide | amolwable.com linked to this post on November 15, 2009

    [...] my previous post, “CSS Formatter and Optimiser” I have given basic idea about CleanCSS Optimiser tool and how it does CSS optimization. CSS [...]



Some HTML is OK

or, reply to this post via trackback.