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 4 of 4

Thread: Background tag

  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Location
    Hallandale Beach, FL
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Background tag

    I'm learning HTML/XHTML from a book and now I'm trying to insert a background and I can't get it to work this is the tag I'm using:

    <body style="background-image:"C:\Documents and settings\Administrator\Desktop\web_site\Pictures\chalk.jpg" />

    for some reason this does not work, can someone help me?

  • #2
    Regular Coder
    Join Date
    Mar 2009
    Location
    Troutdale, OR
    Posts
    147
    Thanks
    12
    Thanked 6 Times in 6 Posts
    Code:
    <body style="background-image: url('C:\Documents and settings\Administrator\Desktop\web_site\Pictures\chalk.jpg');" />
    Try it.

  • #3
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    Quote Originally Posted by vicgui View Post
    <body style="background-image:"C:\Documents and settings\Administrator\Desktop\web_site\Pictures\chalk.jpg" />
    Is that some code you made up or is the book telling you to put that? If the book has quoted that code then I would chuck that book in the bin and start again.
    You can not say you know how to do something, until you can teach it to someone else.

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    <body style="background-image:"C:\Documents and settings\Administrator\Desktop\web_site\Pictures\chalk.jpg" />
    Anyway that path is of Windows and can't be used in a webpage as it needs a *NIX like path.

    If your html page is located in the web_site directory, use a relative path like
    Code:
    background:url('Pictures/chalk.jpg')
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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