Here’s a quick tip for today. Usually, I code Wordpress themes for my blogs using Crimson Editor by hand. I think it’s better than what we can get from the notepad built-in Windows because the original notepad has limited undo and redo function. So it’s quite a pain in the ass to revert the changes if we did a mistake while coding.
Back to the title you might wonder how you can optimize your CSS file so that you can shorten the time for your website to load. Fortunately I found a website called Clean CSS introduced by a friend and also a famous Malaysian tech blogger Cypherhackz in his blog.
Clean CSS is a nice utility that will tidy up your CSS file by shorthanding the CSS properties and eventually trim down the overall size of the CSS file. It will also remove unnecessary things. Look at the example below to understand how it works:
Instead of this (the original untidy CSS)
#nav a {
color:#999;
text-decoration:none;
padding-left:14px;
padding-right:14px;
padding-top:6px;
}
It will convert it into this (optimized one)
#nav a {
color:#999;
text-decoration:none;
padding: 6px 14px 0px 14px;
}
While some might say that professional web developers won’t need this, I suppose it’s still useful for beginners to learn how to write better, semantic codes from the result produced.
Try Clean CSS out | Credit: Cypherhackz
April 14th, 2007 at 5:35 pm
if you can code css by your own, you can make it load more faster. that website is just a simple tool that will make it easier for you only. btw thanks for the linkback.
April 14th, 2007 at 11:16 pm
cypherhackz: Previously, I’ve tried other sites that offer the utility but they made the css file spoiled. So I guess this is a good one for us to quickly optimize wordpress template made by other designer.
April 19th, 2007 at 4:28 am
i am trying to do like that but my css become su*k
April 19th, 2007 at 4:38 am
fahmishah: You can compare your CSS file with another theme file to find what’s wrong there. So far, I’m not yet experience any problem with this tool. So, good luck!