The background image will be downloaded only once.
To verify this, you can check which resources are loaded in Chrome by following these steps:
- go to web page
- right click anywhere on the page
- click check item
- click network tab
- refresh the page
All downloadable resources will be displayed in this list.
Alternatively, you can dry your CSS as follows:
.box1, .box2, .btn{ background-image: url('../img/sprite.png') } .box1{ background-position: 0 0 no-repeat; } .box2{ background-position: 0 -20px no-repeat; } .btn{ background-position: -100px -60px no-repeat; }
source share