Background images from my harddrive using css

Discussion in 'CSS' started by duceswild557, Sep 23, 2007.

  1. #1
    I have a css file that is linked to the html file, and i am trying to get a picture set as my background, i know how to do it if i upload it to the internet and then link it to my css file (im doing this in notepad btw), but it doesnt work when i do it with images on my comp.

    background-image:url(Habitat_Pics/background.jpeg);
    background-image:"Habitat_Pics/background.jpg";

    ive been trying everything i can think of , mainly those two for the last few hours, it is driving me crazy and any help would be greatly appreciated.
     
    duceswild557, Sep 23, 2007 IP
  2. simonpeterong

    simonpeterong Peon

    Messages:
    62
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you have the images and the html file on one folder, you can do it as you were doing it online..

    eg.

    <img src="images/bg.jpg" alt="bgimage" />

    But if you are using other images outside your web folder, I think you have to copy the exact location of the image...

    eg. <img src="d:\mypictures\folder1\folder2\folder3\bg.jpg" alt="bgimage" />
     
    simonpeterong, Sep 23, 2007 IP
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That one's not valid. The first one is.

    The website uploaded to the Internet cannot see the image files on your computer. As Simon said, you need to give it the complete path... and they also need to be online. Wherever you're uploading this html and css to, that's where the images (or copies of them) must be. And then you'll see them.
     
    Stomme poes, Sep 24, 2007 IP