Re: CSS Background Image

by Andrew McFarland <aamcf(at)aamcf.co.uk>

 Date:  Sun, 14 Jul 2002 22:36:48 +0100
 To:  hwg-tech <hwg-techniques(at)hwg.org>
 In-Reply-To:  snet
  todo: View Thread, Original
At 16:01 14/07/02 -0400, Paul Kmecak wrote:
>Westciv.com says since the url is relative to the style sheet, not the
>HTML, an absolute address, not a relative address is best.  The absolute
>version is

The url is relative to the stylesheet, so all you have to remember is to 
make the url relative to the stylesheet.

I usually do this by making the url relative to the root of the web server:

url('/images/foo.gif')

There is nothing wrong with a url like url(../images/foo.gif), although 
that sort can be harder to keep track of, particularl;y if the stylesheet 
moves around a lot during development.

Using an absolute url will cause problems if you ever move the site from 
one domain to another [1].

>If anybody can provide insight as to what I'm doing incorrectly, or
>point me to a site where this is done correctly, I would appreciate it.

http://aamcf.co.uk/styles/blue.css - slightly verbose to aid clairty.

Andrew

--
http://aamcf.co.uk/

[1] I do this quite often in work: dev.site.unite.net becomes 
demo.site.unite.net and finally test.site.unite.net depending on the stage 
of development.

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA