copyright © CSSPG, lud October 18 2000


 for practical use of CSS

Tips

this document is located at...
<URI:http://css.nu/pointers/tip-4.html>

* Use of absolute URIs *

In ciwa.stylesheets, Jelks Cabaniss responded to the following problem by suggesting the use of absolute URLs in CSS files:

  > I just started experimenting with style sheets, and have been having
  > troubles with background images.  I am able to view the pages fine locally,
  > but I.E. 4.0 won't display the background image after I have uploaded the
  > page and all necessary files.  Other graphic files using the same relative
  > address will display though.  Any help would be greatly appreciated.  By the
  > way, this site is just an experiment and is not complete.
  > You can view the page at http://web.wt.net/~mrmullen

 

Welcome to IE4, which broke _embedded_ stylesheets after IE3. ;) The only fix I've found for this is to use an absolute URL. Thus

    body { background: white url(x.gif) }

 

becomes

    body { background: white url(http://web.wt.net/~mrmullen/x.gif) }

 

Of course, if you're doing this at home, you'll have to make sure connected to the Net to be able to see your background! <g>

  -- Jelks

 

Note:

This workaround happens to fix a NN4 bug as well. Bug reports have already been filed.

Update:

Jelks reports the reports that the disappearing background bug disappears if you reference the background URL inline, like:

        <body style="background: url(blahblah.gif)">


CSS Pointers Navigation
Index · Browser Bugs · Books · Tools · DHTML · XSL & DSSSL
Main Site Navigation
Index · Articles · Examples · Experiments · FAQ · Markup · Styles · Who is?
CSSPG ~ Sue ~ Roland
Validate markup Check CSS