W3C home > Mailing lists > Public > www-style@w3.org > November 2001

Re: How to preload background image

From: Tantek Celik <tantek@cs.stanford.edu>
Date: Sun, 18 Nov 2001 12:52:29 -0800
To: Cristiano Guglielmetti <guglielmetti@tin.it>, www-style@w3.org
Message-id: <0GN000I2FKHD8B@mta5.snfc21.pbi.net>
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.

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


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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:59 UTC