[thelist] relative paths in CSS

Burhan burhankhalid at members.evolt.org
Sun Aug 11 19:41:01 CDT 2002

On Sunday 11 August 2002 05:22 pm, Rob Oviatt wrote:
> 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?
> body {
>          font-weight : normal;
>          font-family : "Times New Roman", Times, serif;
>          font-size : 12px;
>          background-image: url(images/bg.gif);
>          background-position : center;
>          color: #2A4F6D;
>          background-color : #fab400;
> }

Did you try using quotes? Sounds silly, but it could fix the problem.
background-image: url("/images/bg.gif");

Also, when the image doesn't display...right click on it and choose
properties. Then you can see where it is looking for it. It helps me when my
paths are messed up.


More information about the thelist mailing list