How to add pictures as a background image in HTML?
I just today finally was able to add pictures to my website, but now I want to create my own background image. I tried to do the same thing I did with the picture file, instead I changed the code from img src to body backround. What am I doing wrong? I made a picture on Microsoft Publisher and saved it as a GIF image, and it's in My Pictures file. How do I get it to be my backround image??? I do this code:
<body backround="picture.gif">
but it doesn't work!!! can u give me a link that helps me? And not w3schools cuz I've already been there. thx ;]
Public Comments
- i dont do this stuff
- The word isn't "backround", it's background, like the opposite of foreground.
- Use CSS. Like this... <body style="background-image: url (location of the image);"> http://www.tutorialhero.com/tutorial-52-css_background_image_guide.php http://www.codeave.com/css/code.asp?u_log=4014
- <body background="put URL here"> it works your probably just not linking to the image correctly.
- Something like this ought to do it: <body style="background: url("image.jpg") no-repeat fixed center gray;"> The site below has good html & css tutorials.
- The easies way is this: <body style="background: #fff url(My%20Pictures/image_name.gif) no-repeat center fixed;"> This sets a white background color (#fff), calls your image from the My Pictures folder, keeps image from being tiled, centers image on page and allows your pages content to scroll while keeping image fixed in the background. If you have an image that must be tiled to fill your page and you want the image to scroll with the page's contents, then use this: <body style="background: #fff url(My%20Pictures/image_name.gif) repeat center scroll;"> I take it that you have the same named folder on your website for the image although I would put all the images for your web site in a folder called images. It is bad coding to use caps and space in folder and file names. Ron
- so your picture location must be corect for html page if you have folder named piczture with your html page where you want to put pictue u must write pictures/picture.jpg
Powered by Yahoo! Answers