achtungbaby.net

Icon

Postcards from the Front-End

Preloading Images with CSS

A nifty way to use CSS to preload images (from specere.net):

#preloadedImages {
width: 0px;
height: 0px;
display: inline;
background-image: url(path/to/image1.png);
background-image: url(path/to/image2.png);
background-image: url(path/to/image3.png);
background-image: url(path/to/image4.png);
background-image: url();
}

#preloadedImages then gets added after body. Especially good for page-specific style sheets.

Category: Technology

Tagged: ,

Comments are closed.

@achtungbaby

  • Could not connect to Twitter