Weekend Projects: Clean Up Your CSS

Posted on November 15th, 2008

Weekend Project

Do you use CSS on your site? I know more and more sites are using CSS as a standard. The problem is a lot of CSS you see is very messy. This weeks project is to clean up your CSS. Having bad code can effect users and bots so it is a good idea to clean up any problems in your CSS.

Finding your CSS
Some of you may not even know you are using CSS or not. To find out open your site in your browser and go to Tools and choose Source (or Page Source for FF).  Scan your code or do a CTRL+F and look for anything with .css in it. Copy that link to your css as we will need that for the next step.

If you are using a WordPress blog you might have several CSS files look for the style.css file. For example for our blog the CSS file is here http://blog.bluefur.com/wp-content/themes/bluefur/style.css.

Ready, Set, Scrub
Now that we have the link to our CSS file we can open the Clean CSS site and paste your link into the CSS from URL box and click Process CSS.

You will see below that it will provide you a list of messages. Read them over to see if there are any issues. If there are then fix them in your CSS file.

If you get stuck let me know in the comments.

Posted in Weekend Projects | | | Digg This | del.icio.us | Technorati


Related Topics:
Weekend Projects – Optimize Your Code
Weekend Projects: Log Check
Wordpress Wednesdays: Smart Archives
Weekend Projects – Email Signature
Weekend Projects – Web Accessibility Check

RSS feed

3 Comments

Gravatar
Comment by Tony Chung
2008-11-15 14:15:07

I’d also recommend that plugin developers ensure their code creates clean HTML and CSS as well. I’ve had to remove W3C buttons from my site because the plugins + the theme I chose = bad combo resulting in oddly nested tags. I hope to fix this when I hack my own theme, whenever that will be.

 
Gravatar
Comment by Firany Subscribed to comments via email
2008-11-17 05:14:10

I think clear html is much more important than CSS. I forget about it – just leave it to my wordpress template developer.

 
Gravatar
Comment by InvestorBlogger Subscribed to comments via email
2008-11-20 10:22:07

Do keep a copy of your original CSS file. If CleanCSS screws up, at least you can restore it easily. I know I made that mistake once already.

Kenneth

 

Sorry, the comment form is closed at this time.

© 2007 BlueFur Hosting | Privacy Policy
Theme by Unique Blog Designs