Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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 by teodora
Please use "code <>" when you paste code :)

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 by teodora

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 by Samus

  • 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.

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

  • 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.

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.