[thelist] relative paths in CSS

aardvark roselli at earthlink.net
Sun Aug 11 19:39:00 CDT 2002

> From: Rob Oviatt <rgoviatt at nbnet.nb.ca>
> How do you express relative paths in CSS?  I'm using the body style
> (below) to load a background image for a web site I've built.  It
> works fine in IE, but Mozilla 1.0 doesn't find the file.  If I remove
> the "images/" and drop a copy of the gif in the same directory,
> Mozilla can find it.
> I've been surfing the net, but every example of "background-image"
> I've found, doesn't use a sub directory as the source.  Can anyone
> shed some light on this?

here's a line of code from my CSS:

	background-image : url(/files/as_images/casebg_cms.gif) ;

you'll note the leading slash on the path... i go for root-relative
links because then i never have to worry about paths... that way the
brain cloud (what's a brain cloud?) i get while reminding myself how
paths are relative to the calling document is unnecessary...

i'd suggest you try that...

Read the evolt.org case study
Usability: The Site Speaks for Itself
ISBN: 1904151035

More information about the thelist mailing list