Archive for the 'css' Tag



CSS Tip: Preloading Images With CSS


Fri, January 12, 2007


Image Preloading

CSS Tip: Preloading Images With CSS
First, let’s create a class with display set to none and add it to the HEAD section of the home page:

<style type="text/css">
.hiddenPic {display:none;}
</style>

Next, we’ll add image tags for our puppy pictures to the bottom of the home page. Always place them at the bottom of the page! If the visitor is at the home page, you certainly want it to display as quickly as possible. Let the browser display the home page and its images before it starts trying to retrieve the images for the next page.

<img src="poodle-puppy-Clara.jpg"
alt="Clara at 8 weeks" title="Clara at 8 weeks"
height="350" width="350" class="hiddenPic"/>
 
<img src="poodle-puppy-Kenny.jpg"
alt="Kenny at 10 weeks" title="Kenny at 10 weeks"
height="350" width="350" class="hiddenPic"/>
 
<img src="poodle-puppy-Aiko.jpg"
alt="Aiko at 6 weeks" title="Aiko at 6 weeks"
height="350" width="350" class="hiddenPic"/>

Share
Close Move

Share This Post!













wordpressk2feedfeed

About

This is a website that is unparalleled in its awesomeness; deffinately worth shouting "GollyGolly" repeatedly as loud as you can. Try it.


Proudly powered by Wordpress and Dreamhost.