If a page has multiple facebook/twitter buttons for multiple stories (24 buttons for 24 stories), its creating 24 files for fb likes and 24 folders for twitter where count is saved. This is making the page heavy unnecessarily. Can we store it in single file? Please help.

1 Answer 1


You need to start using css sprits, this allows you to load one image file and with css display only the section of the image that you need.

img.home {
    background:url(img_navsprites.gif) 0 0;

In the example above you see that starting at position 0x0 in the image we display a rectangle 46px x 44px.

  • You should not use or link to w3schools. It's not a reliable source of information and we don't want to encourage its use. I recommend using the Mozilla Developer Network instead. (But +1 for a good answer nonetheless).
    – John Conde
    Aug 19, 2013 at 22:10
  • Good point @JohnConde, I've changed the reference. Aug 19, 2013 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.