Compressing your CSS Stylesheet

by Alex
Posted in CSS, Tutorials on April 14th, 2007

Compressing your CSS file is a great way to save bandwidth especially on big websites. The are loads of firms that will compress the CSS files for you but the problem is that you need to recompress it after each modification.

To solve this and do the compression yourself you need to write a few lines of PHP code.

Read the tutorial here 

Related posts

You might also like these similar articles:

  1. PHP: Uploading a File Tutorial [Script]
  2. PHP file upload tutorial
  3. 20 Tips and Tricks to Speed-Up Your Wordpress Blog
  4. 3 weird facts about Microsoft Windows
  5. Send mail with attachment via HTML form

Share this article
Got something to say ?Leave a comment
  • Billigflüge
    May 6, 2008 at 11:01 am

    Ingeniously, I can use well.

  • Aura99
    June 28, 2008 at 10:22 am

    I have come across CSS compression before, but have found that the removal of white space during compression only amount to a few kb maximum saving on the file size much better to shave of the files size of Images or Flash or other objects.

    I have found the best approach is to use the @import and separate the style sheets out for individual templates. This works great with the CSS being cache in the browser at initial download. So you only download the CSS you require for that page! Back to the CSS, if you code each declaration line by line and using inheritance also makes the CSS more readable e.g.

    div.ClassName p { some: XXX; styles: XXX; here: XXX;
    div.ClassName p.OtherClassName { }

    When I say more readable, it makes it easier to traverse the DOM and find out the specificity of the styles in conjunction the semantics of the HTML you are styling.

Add a commentGet a Gravatar

* Name

* Email Address

Website Address

You can usethese tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackbacks


Sponsors
PSD to HTML
Elegant Wordpress Themes PSD to HTML
Favicon Ads
Share your design news Free Joomla Templates Free mediawiki skins Free pligg templates Flash web templates Web Design and Graphic Design Forum CLD Vectors - Free Vectors for Download Free Vectors
RSS Feed
Around The Site
Sponsor
The World's Best Web Design
Sponsors
Need templates ?
Thousands of themes and templates
User Links Panel
RSS User Links
Friends
We recommend
Sponsor

Money Saving Tips
Find cheap business cards printing, postcard printing and brochure printing by searching for online coupons. Search terms like "print flyers coupon code" in your favorite search engine.