Re: How to preload background image

From: "Cristiano Guglielmetti" <guglielmetti@tin.it>
Subject: How to preload background image
Date: Sat, Nov 17, 2001, 11:39 AM

> Using:
>
> body
> {
>  margin: 0;
>  background-image: url('../images/bkgdbase.gif');
>  background-color: #ffffff;
>  font-family: Verdana, Arial;
>  font-size: 8pt;
>  color: #336699
> }
>
> the background image is loaded by the client at the same time of the text
> and others images.
>
> Is there a method to pre-load background image as first and then other
> objects?

A similar topic recently came up in a HTML working group meeting.

> I found some improvements removing "background-image" from CSS and putting
> <body background="image"> in the html.

Actually, leaving both in should be fine.

Optimally, this concept of "pre-load" would just be another LinkType[1],
e.g. it would be nice if putting this in the <head> worked:

<link rel="preload" href="../images/bkgdbase.gif" />

One way to get a background image (or other stylistic image) loading very
soon after the document starts loading is to reference it from an image tag
in the document which is then hidden using CSS, e.g.

...
<body>
 <p style="display:none">
  <img src="../images/bkgdbase.gif" />
 </p>
...


Tantek

[1]
 http://www.w3.org/TR/html401/types.html#h-6.12

Received on Sunday, 18 November 2001 15:49:22 UTC