Blogging Fever

Your next level of blogging skill starts from here.

  • Home
  • Contact
  • Archives
  • About
  • Resources
  • Newsletter

How to greatly speed up your website with CSS Sprites

How to greatly speed up your website with CSS Sprites

Okay, remember I had been talking about site speed with you and how I increase my site speed with the W3 Total Cache.

Yes, you can head over to that post to learn more if you are more into cache at the moment.

However, today we are going to take our site speed optimization to another level.

I’m not too sure how many of you had came across this term ‘CSS Sprites‘, but I had been ignoring this since a while ago until I finally have some time to look into it last week.

The reason of my ignorance is because I find it too troublesome to implement and the reason I am writing this blog post is to tell you how simple is it for you to do it.

Image courtesy of domdeen / FreeDigitalPhotos.net
Image courtesy of domdeen / FreeDigitalPhotos.net

So, this is the big deal.

CSS Sprites is a method where you combine all your images of your website into one single big piece of image.

How this helps you to speed up your site?

I’d like to explain in a very human manner here so let’s put it this way. Imagine you are requesting five photos from your friend, you are going to do it this way without CSS Sprites:

Can you pass me the photo of Mary?

Can you pass me the photo of Jane?

Can you pass me the photo of Jessica?

Can you pass me the photo of Bella?

Can you pass me the photo of Kristine?

Your friend is going to be very busy passing you the photos one by one and this is the reason behind his poor performance.

Now with CSS Sprites, it is going to be:

Can you pass me the photo of those girls?

What your friend does now instead is to pass you a big piece of photos with all the girls and a piece of paper telling you where Mary, Jane, Jessica, Bella and Kristine positioned respectively.

Your friend’s job is done here and that goes the same to your web hosting server as well.

So, the outcome is, by implementing CSS Sprites, you reduced the HTTP request to your server (Gosh! I hate this tech term).

Imagine if you have 30 images to load, you are going to request 30 times and if you have 100 visitors at that time, it is a total of 3,000 requests!

If you started to think this seriously just like I do, start combining your images and here is my guide.

 

How to apply CSS Sprites the easy way

To optimize your site with the CSS Sprites methodology, you will need to do the following:

  1. Merge your images into one.
  2. Update your CSS scripts.

 

1. Merge your images into one

There are few ways to do this and the way that I do is to use SpriteMe. If you are planning to use the same way as I did, here are your steps:

  1. Add SpriteMe.org as your bookmark.
  2. Go to your site’s home page.
  3. From your bookmark, select the SpriteMe.org page and you will see some purple panel appear on your right.
  4. Those are the list of images that you want to combine them into one. What you need to do here is to click on the ‘Make Sprite’ button.make sprite
  5. You will need to keep tract of two things here. First is your sprite image and second is the coordinates of your actual image.sprite and coordinate
  6. You can have a look at my sprite image just to ensure you are doing it right. Click here to view my sprite image.

 

2. Update your CSS script

Now, it is time to complete your process. Before you proceed to update your CSS, save a backup copy so that if you happen to screw up, you can still revert it back easily.

  1. Go to your CSS content.
  2. Change the original image file to your sprite image file.
  3. Add a new line of the coordinate of the original image file in your sprite image. You can get it from step 5 of SpriteMe.org above.
  4. Below is an illustration of what you need to do.Update CSS

The conclusion

The only difficulty I can see from applying CSS Sprites is the replacement of images in your CSS script which is quite a lot!

If you are really eager to implement this optimization, be sure you allocate yourself at least 30 minutes to do these optimizations.

So back to you now, have you implemented CSS Sprites before and what is the result?

Feel free to tip me as well on what are your thoughts on this guide.

(Visited 128 time, 1 visit today)

You might also want to check out:

Businessman risingHow to super charge your WordPress blog loading speed submit url to GoogleHow to let Google know that you have a blog now Google PagerankGoogle Toolbar PageRank Update – August 2012 Simple On-Page SEOSimple SEO setup for your blog post

Filed Under: Editor's Pick, SEO, Wordpress Tagged With: CSS, SEO, SpriteMe, wordpress

Love this article?

Enter your email below and receive great contents on a regular basis.

About Alan

Alan @ Blogging Fever.

Comments

  1. Fred says

    December 19, 2012 at 10:21 pm

    I recommend to use Less CSS and also minimize image size.
    Also use JavaScript in separate files, it would be great help for blog speed.

    But you have share a nice trick thanks 🙂
    Fred recently posted..diamond ring under $1000My Profile

    Reply
  2. Philip A says

    December 24, 2012 at 5:41 am

    Hi Alan,

    Thank you for sharing this info, although I’m quite use to screwing up my blogs layout with my personal design testing, I don’t think I can manage to do what you’re showing here.

    I think I’m gonna install wordpress on a subdomain and try this on that one, maybe I’ll manage to do it.

    Happy Holidays, take care.

    ~Philip
    Philip A recently posted..Building Trust – The Key to Growing Your Online Home BusinessMy Profile

    Reply
    • Alan Tay says

      December 24, 2012 at 9:10 am

      All the best there, Philip. I’m sure you can handle it 😉

      Happy Holiday there ~ !
      Alan Tay recently posted..How to greatly speed up your website with CSS Sprites My Profile

      Reply

Trackbacks

  1. The Killer Strategies How To Speed Up Your Website says:
    September 24, 2013 at 4:49 pm

    […] How to greatly speed up your website with CSS Sprites […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Confirm you are NOT a spammer

CommentLuv badgeShow more posts
This blog uses premium CommentLuv which allows you to put your keywords with your name if you have had 3 approved comments. Use your real name and then @ your keywords (maximum of 3)

Free Updates

Subscribe to my mailing list

Must read series



Popular articles

  • How to fix these 100 blogging mistakes and build a…
  • 7 ways you can make money from the internet
  • 5 forbidden SEO moves that you should stop using
  • How to build a restaurant website using WordPress
  • How to Install WordPress into your Web Hosting
  • 10 Adsense income reports to motivate your Adsense…
  • Case Study: How I drive my first 100 Twitter visitors
  • About Blogging Fever
  • 18 fundamental facts to prepare you for SEO
  • 7 blogging lessons I learned from Men’s Health…
  • About
  • Write for Us
  • Resources
  • Newsletter
  • Archives
  • Contact Us
  • Privacy Policy
  • Terms of use

[Blogging Fever]

Copyright © 2012 - 2020 Blogging Fever powered by Genesis Framework

Subscribe Now & Get Free eBook
Plus Bonus Email Course on Traffic Generation Technique
Arrow
BESbswyBESbswy