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.

100% Width Div behind content Z-Index trouble

Featured Replies

Hi Guys,

 

Just wondering if someone could give me a pointer on something...

 

Working on a new site, just putting a sample page together, can be found here:

http://new.hampshireinsulations.co.uk/

 

I'm aiming for this, and am having trouble laying the polystyrene balls on the side of the content correctly:

http://www.hampshireinsulations.co.uk/mock.jpg

 

Pretty sure I need to z-index the balls_wrapper behind #main, but not sure of exactly how to do it, or if there is a better way...

 

Any feedback would be really appreciated!

Your polyballs.png image is 1600px wide, which means a lot of browsers won't ever see the balls at the sides. Do you really want it this wide?

 

You could make the image a more convenient width, say 1000px (less black in the middle), and used a fixed width wrapper for the whole page 1000px wide. Use the 1000px wide image as a background-image for a div, call it #polyballs, and then place another div with a white background and the TV inside it so the white and TV is over the top, centered. I'm assuming that the area outside the balls is transparent so the gradient gray of a wrapper background would show through.

 

If you want a fluid width layout it would be more complicated. You would have two images for just the polyballs and position them in side divs while the center div with the TV would be flexible in width.

  • Author

Hi Wickham, (no pun intended...)

 

Thanks for your response, the size of the image will be changing, this is just a sample image at the moment...

 

The problem with maybe using it in the same div as the TV, is that the TV is only going to be on the homepage- in your opinion, would it be best to maybe have two divs each containing just the image, and somehow align them bottom left and bottom right next to the content? This is where I'm getting a little lost.

 

My idea was to have a div underneath the content with one image (blank in the middle) aligned center and then the balls on either side which would stay the the bottom of the page, but am having trouble getting these behind the content- I thought this is where z-index came in?

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.