#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    66
    Rep Power
    3

    Css background image


    Hi so I am trying to use a image I made as the background for my web page. To accomplish this I tried to use a line of CSS code in the style tag but it does not seem to be working. Can anyone help? Thanks - Nick


    Code:
    <html>
    <head> 
    <em><title>Home|Abstract Workshop.com </title></em> 
    
    <!--Define the stylistic elements--> 
    <style type="text/css"> 
    
    .txtshadow
    {
    text-shadow: 2px 4px 3px rgba(0,0,0,0.3);
    }
    
    body{background-image:url('background.png');} 
    
    </style> 
    
    <!--Create the meta data for the Browser--> 
    <meta name="keywords" content="Abstract Tech,Abstract,tech,FMR,mini rectenna,self powering laptop,functioning sonic screwdriver,screwdriver,sonic">
    <meta name="description" content="A custom and innovative technolgy componany brining futuristic and cutting edge technology into the present"> 
    <meta charset="UTF-8"> 
    </head> 
    
    <!--Open the Body Tag--> 
    <!--This is the code for the home page--> 
    <body>
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Location
    Jakarta, Indonesia.
    Posts
    218
    Rep Power
    32
    Hi Nick.
    The css looks okay to me.
    Is it possible that your <body> still has no content?

    Hendra
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    66
    Rep Power
    3

    Thanks but its still not working


    Thank you for replying but it is still not working I have a theory that it might have something to do with my browser so I will try switching browsers
  6. #4
  7. No Profile Picture
    buildmyweb.org
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Location
    NY
    Posts
    75
    Rep Power
    8
    nick, make sure the path to the image is correct. that is often a problem when backgrounds dont show. your css looks correct. tho as hde illuminates, we have to guess at other possibilities without seeing the whole file.
    Freelance Web Developer | PHP Applications
    Web Development, Hosting, Graphic Design, SEO
  8. #5
  9. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Location
    Ludhiana
    Posts
    33
    Rep Power
    0
    try:

    body{

    background:url('background.png') no repeat;
    position:fixed;

    }
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    5
    Rep Power
    0
    your close the <style> before the <body>..
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    6
    Rep Power
    0
    I have just used the same code and it works fine....
    I think you are not giving the right path. Try to use relative path.

    background-image:url('../Desktop/lion_hd_wallpaper.jpg')
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    27
    Rep Power
    0
    Try out using the below code example.

    body
    {
    background-image:url('paper.gif');
    background-color:#cccccc;
    }

IMN logo majestic logo threadwatch logo seochat tools logo