Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Dec 2008
    Posts
    81
    Thanks
    11
    Thanked 1 Time in 1 Post

    header image not working FF

    I have a back-ground image for my header which seems to only be working in IE but not firefox. I cant understand why its not working. Here is the css code for the
    Code:
    #header {
    	width: 1000px;
    	height: 150px;	
    	background-image:url(D:/Websites/Study/shout-africa/SHOUTAFRICA/bigshout/root/images/shout4.jpg);
    }

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Code:
    background-image:url(D:/Websites/Study/shout-africa/SHOUTAFRICA/bigshout/root/images/shout4.jpg);
    Use relative path to refer that image.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Dec 2008
    Posts
    81
    Thanks
    11
    Thanked 1 Time in 1 Post
    Thanks I am still new to css but I managed to solve it using your reply.

    So to use a relative path I will have to add
    Code:
    ../images
    thats just an example?

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    So to use a relative path I will have to add
    Code:
    ../images
    thats just an example?
    The path will depend upon the relative position of your html file(or the css file, in case of external css) and image. Where are they located in your case?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    New Coder
    Join Date
    Dec 2008
    Posts
    81
    Thanks
    11
    Thanked 1 Time in 1 Post
    In most of my projects the css files will be in the same parent folder with subfolders for images, php includes, javascripts etc only the index.php or index.html is stored in the parent folder.

    I hope you can understand my explanation.

  • #6
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    if your folder set up is like so:
    PHP Code:
    site root (parent folder)
           |-
    index.php
           
    |-style.css
           
    |-images
                  
    |-img1.jpg
                  
    |-img2.jpg

    /* then use */
    style.css:
    background:url(images/img1.jpg); 


  •  

    Posting Permissions

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