dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: inserting background image

  1. #1
    Join Date
    Dec 2008
    Posts
    12

    Question inserting background image

    I'm having problems inserting a background image on my page. I've done this before but I took some time off and now for some reason it isn't working for me. Below is the tag I'm using, if there is something wrong can someone please correct it for me?

    <body style="background-image:url(C:\Documents and Settings\Administrator\My Documents\HTML BASICS\html unprinted\my web docs\Pictures\web page backgrounds\b4.jpg); />

  2. #2
    Join Date
    Sep 2008
    Posts
    408
    Instead of C:\Documents and Settings\Administrator\My Documents\HTML BASICS\html unprinted\my web docs\Pictures\web page backgrounds\b4.jpg I would say use a relative url path since that will not work online.

    So have your folder setup like:

    /webpage/page.html
    /webpage/images/b4.jpg

    and then on page.html (or whatever your page is) include it with: url(./images/b4.jpg)

  3. #3
    Join Date
    Jan 2008
    Posts
    123
    Also,

    Your <body> has a closing tag in the wrong place. You might be breaking it by having the / at the end.

    Try:

    HTML Code:
    <body style="background-image:url(C:\Documents and Settings\Administrator\My Documents\HTML BASICS\html unprinted\my web docs\Pictures\web page backgrounds\b4.jpg);">
    
    <!-- Copy -->
    
    </body>
    Also, as noted before, this will only work locally. If you are trying to place this online it will not work since the file is stored on your computer and not on your chosen web server.

    Hope this helps,

    --thesprucegoose

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles