19Dec

Preload images css

In an app, interactive advert, etc., it can be useful to preload some assets before some others to make sure users have a great experience seeing your content.

How to do preload images using CSS only


body:before {
/* preload large images */
content: url(images/bg_splash.jpg) url(images/road_sprite_fast.jpg) url(images/car.png);
display:none;
}

Leave a Reply