CSS Sprites
If you save the page of a modern popular site, you may notice an
interesting thing. A few small pictures merged into one image. For
example, go to YouTube.com. The current version of the page contains this
picture.
As you can see, Google's developers have combined several images into one. Then they've used CSS code to show the icons in the right places.
Why have they done that? Why do they put a few pictures into one image?
The fact is that modern web pages contain hundreds of objects. It could be a style sheet, JavaScript, videos, music, flash, images, icons, etc. Downloading each object requires a separate request to the server. And, if the page contains 100 objects, it will require 100 requests. Now, imagine that each request takes a time to complete. Do not forget about latency. Now you understand that downloading a web page can take a very long time.
Search engines recommend webmasters dedicate some time to improve the performance of their website. Website speed is often more important than visual appearance. When you combine several pictures into one image, you reduce the number of server requests and bandwidth. This technology is called 'CSS Image Sprite'.
Suppose you have a blog, and you've decided to add social buttons to promote your website in social networks. Put one image, instead of several pictures!
You should get this image:
2. First, create a simple HTML list: /h3>
As you can see, Google's developers have combined several images into one. Then they've used CSS code to show the icons in the right places.
Why have they done that? Why do they put a few pictures into one image?
The fact is that modern web pages contain hundreds of objects. It could be a style sheet, JavaScript, videos, music, flash, images, icons, etc. Downloading each object requires a separate request to the server. And, if the page contains 100 objects, it will require 100 requests. Now, imagine that each request takes a time to complete. Do not forget about latency. Now you understand that downloading a web page can take a very long time.
Search engines recommend webmasters dedicate some time to improve the performance of their website. Website speed is often more important than visual appearance. When you combine several pictures into one image, you reduce the number of server requests and bandwidth. This technology is called 'CSS Image Sprite'.
How it Works
Suppose you have a blog, and you've decided to add social buttons to promote your website in social networks. Put one image, instead of several pictures!
1. Preparatory period.
Combine these icons in one image using a graphic editor:You should get this image:
