Bluehost: Web hosting from $3.95/month. Sign Up

How to optimise your CSS code

Posted on by Clive Walker in Web Development CSS

Code Beautifier is a useful website that optimises and formats CSS files. The website will take your style sheet file, remove whitespace, clean up style rules by removing unnecessary characters, and carry out several other optimisation or file compression techniques. The resultant CSS code is more streamlined and the savings in kilobytes can be impressive.

One of the good things about Code Beautifier is that you can decide how much compression or optimisation you want. It is possible to choose several options ranging from Highest (no readability, smallest file size) to Low Compression (high readability). Or, choose a Custom option where you decide what options are used.

The other reason for using Code Beautifier is to learn about more efficient CSS code because it will often identify CSS optimisation tips that you may not be aware of. For example, I sometimes use "0px" as a value in my style sheets when I could just use "0". After all, zero is zero whatever the unit of measurement used. There's no need to specify pixels in this case.

Try out Code Beautifier. I think you'll find it useful.

Related: StripMe uses a slightly different approach to remove whitespace and comments from CSS files. Simply link your CSS file to the StripMe service and it will do the work for you.

Technorati : ,

Leave a comment

A simple question that helps prevent automated form fillers.

© 2016 Clive Walker