Search code examples
csspreloadpreloadingimage-preloader

How to pre-load images only using CSS (no JS)?


How can I pre-load images only using CSS, so without using JavaScript? It has to be cross-browser.

I don't want to use CSS sprites. Is there any other solution?


Solution

  • You can use multiple elements, hidden with background-position: -1000px -1000px; and give them a background-image for each image that you want to pre-load.