XHanch Studio Log in | Register | Cart

Forum

[How to] Preload im...
 
Notifications
Clear all

[How to] Preload images with CSS

1 Posts
1 Users
0 Likes
1,227 Views
XHanch
(@xhanch-alt)
Posts: 2105
Member Admin
Topic starter
 

Images preloading is required to boost your website performance. On your website, you may have another (hidden) images to be displayed on mouse click, or on mouse hover, or something else. If you don't preload these images, your visitor will have to wait for the images to show up. Your visitor may not see valuable information (if you put it on the image) if they don't find quick show up based on an event.

To preload images via CSS, you can do it like this:

#preload_images{
    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();
}
 
Posted : 20/05/2011 3:35 pm
Share:

× Close Menu