SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2001
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with external stylesheet

    Hi,
    I am using an external stylesheet with the following in it:

    #header {
    background: url(images/headerbak.png);
    margin: 0 0 0 0;
    padding: 0 0 0 0;
    width: 100%;
    height: 90px;
    }

    and at the top of my page:

    <div id="header>
    </div>

    Now when the style rules are in the html document itself, it displays correctly with the background image showing up across the page in IE and Mozilla. However, when I place it in a linked stylesheet, the background is not showing up on the pages in IE and Mozilla. Any idea on how to fix this with the external stylesheet?

    Umesh

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Your url in the stylesheet needs to be quoted. Also, if your linked stylesheet is in a different directory from your pages, you may have problems using a relative image path like that.

  3. #3
    SitePoint Member
    Join Date
    Jan 2001
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the tip. I added in the quotes and moved the stylesheet to the same directory as the pages and it worked fine. Funny though how it works without the quotes if the style rules are in the xhtml file. Is that supposed to happen?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •