Does your site run on Perch CMS? Hire me to help. Perch CMS Development

How to optimise your CSS code

Posted on by Clive Walker in Web Development CSS

I wrote this post a while back. The content can still be relevant but the information I've linked to may not be available.

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 : ,

Does your site run on Perch CMS? Hire me to help. Perch CMS Development

Comments are OFF for this post.

© 2024 Clive Walker