Slash Coding

  • Android Development
  • CSS
  • Subscribe
  • About Us
  • Contact Us
You are here: Home / Web Development / CSS / Compress CSS files to Boost Loading Time

Compress CSS files to Boost Loading Time

By Aneesh Bhatnagar

Last week, I discussed with you all how to improve your page loading time by implementing Lazy Loading on your webpage. Well, that’s not the only thing you can do to improve your page loading time. There are various other ways and one of them is to compress your CSS files. Sometimes, compressing of CSS files is called “Minify“, as it decreases the lines of code in the CSS file. In case you missed my earlier article on how to Lazy load images on your webpage, you can go ahead and read it now.

  • Lazy Load Images to Boost Webpage Load Time

Website Loading Time

There are various ways by which you can compress or minify your CSS files, one is to manually compress a CSS file, which is not recommended as it can take up a lot of time and it pointless when you can automate this work. The other way, that I am going to discuss here today is by using an online tool, which will compress your entire CSS file for you, and hence improving your page loading time.

Let’s get started with the procedure. This is a simple thing to do and can be done by anyone, no special skills required.

Compressing CSS files to Boost Loading Time

  1. Before we begin, I would ask you to have your CSS file handy and open it up in your favorite text editor. I use Notepad++ (Read more about Notepad++ in my old article, specifying the reason why I use it and the reason that you should also use it. You can find that article here).
  2. Now, head over to the CSS Compressor website.
  3. You will be presented with the following screen. Here, make no changes and just head over to your text editor.
    CSS Compressor
  4. Select your entire stylesheet (ctrl + A) and then paste it in the text box on the website.
  5. Now, it will generate a minified version of your CSS style, which you can copy and use.
  6. In your text editor, create a new file and paste this minified text there and then save this file with the name “-min.css”, where is the name of your CSS file.
  7. Well, that’s it. You have successfully compressed your CSS file. In case you want a better compression, you can always choose different options and try your luck.

The reason to save this compressed/minified CSS styles as a new file is that when you need to edit or change some styles, it would be hard to do that on the minified version. For this sole reason, you need to save it as a new file. Also, don’t forget to change the stylesheet reference on your webpage to the newly created style.

That’s all for this tutorial. If you have any doubts or face any problem, feel free to ask them out in the comments section below. Keep subscribed to Slash Coding to know more about all such tips and tricks. You can subscribe via RSS Feeds, Facebook or Twitter.

Did you enjoy this article?
Subscribe to our email alerts when we post something new so you don't miss out.

About Aneesh Bhatnagar

Aneesh Bhatnagar is a freelance web developer, who specializes in front-end website development with HTML5, CSS3 and jQuery. He believes in transforming the entire web into a Responsive Web. He also specializes in use of Bootstrap framework to get websites up and running.

Search Slash Coding

Follow Us

RSS Feeds Facebook Twitter Follow Google+

Categories

  • Android Development
  • C++
  • Developer Tips
  • Slash Coding
  • Web Development
    • CSS
    • JavaScript
    • jQuery
    • PHP

Recently Published

  • Moving Ahead from Front End and Android Development
  • How to Export a Project from Android Studio
  • What is jQuery? Let’s Answer this Common Question today!
  • Mobile App Prototyping : Pixate Studio
  • How to Create a Countdown Timer using jQuery

Subscribe to Email Alerts

Eager to learn more from Slash Coding?
Sign up for daily email updates when anything new comes up. Get it straight in your inbox.

Follow Us on Social Media

RSS Feeds Facebook Twitter Follow Google+

Copyright © 2025 · Slash Coding · Powered by the Genesis Framework
Sitemap | Privacy Policy | About | Contact

×
Get Notified of the new Tutorials when they are posted!
Never miss any article update from Slash Coding. Subscribe to email alerts today!