July 21, 201313 yr I am still quite new to all this web design stuff but I do know the basuic stuff to be able to design my own website, Well the bit I need help in is that for some reason my background image is all set up and the codes right for it to be on the background so it scrolls with the page and now I only just seen that it does load it in firefox at all. So please can someone get back to me asap regarding this. Here is the coding I have used:- <img id="background_image" src="F:\Website Design\Computer Reviews Forum/PC-Desktop-1-1152x864.jpg"></img> #background_image{ width:100%; position: fixed; top: 0; left: 0; z-index: -1; } Edited July 21, 201313 yr by teodora Please use "code <>" when you paste code :)
July 21, 201313 yr Hi I think you need to remove position:fixed; then your background image will scroll with the site. Edit: Replace position:fixed; with: position:absolute; If you are looking for a good background image tutorial, here is one: http://css-tricks.com/perfect-full-page-background-image/ It is fixed, but you can play with it and make it scroll with the background, if you wish. If you have any problems, post here and people will be happy to help HTH Edited July 21, 201313 yr by teodora
July 22, 201313 yr Hi I think you need to remove position:fixed; then your background image will scroll with the site. Edit: Replace position:fixed; with: position:absolute; If you are looking for a good background image tutorial, here is one: http://css-tricks.com/perfect-full-page-background-image/ It is fixed, but you can play with it and make it scroll with the background, if you wish. If you have any problems, post here and people will be happy to help HTH I think background-position: fixed is the correct solution. I think the problem is with z-index. All elements by default have a z-index of 0, he set his to -1 which means it's going to be behind everything by default, probably why he can't see it OP: Set it to anything higher than 0. Might want to set it to something unreasonable (like 9999) incase you have anything else that has a high z-index Edited July 22, 201313 yr by Samus
July 27, 201313 yr Author Thanks for the info but now its changed again and its not in html its all wrote in my css style sheet and now wont show up on any of the web browsers.
July 27, 201313 yr Thanks for the info but now its changed again and its not in html its all wrote in my css style sheet and now wont show up on any of the web browsers. post your code or provide a link
July 29, 201313 yr Author Hey there thanks a lot for the help but I got it working now, But if anything I come to that does not work right then I will surely post it again in this part.
July 29, 201313 yr First of all, the <img /> tag is self closing so you don't need the end tag, you would just do this: <img id="background_image" src="src.jpg" /> Regarding your issue earlier, was it to do with the file source? I notice it's looking for a file on the F: drive. Usually, you would ensure that the image was in the same directory as the HTML file. This may have been your issue.
Create an account or sign in to comment