The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Left side BG not span whole page Re: Left side BG not span whole page


Ah, we have come upon the limitations of CSS yet again!

I have this issue all the time as i love bg images. As far as i know, there is NO WAY to deal with this in CSS. Perhaps you can deal with this in javascript somehow.

Some other simple (albeit compromising) solutions:
1) Apply a fixed height to your div with the bg image. This will unfortunately give you permanent scroll bars, but it will ensure you see the bg.
2) Have the bg fade to the background color at some point far down so it appears to be solid on most pages, but on extra large pages it will fade to white and at least be more appealing.
3) Apply a repeating bg to the body of the page and not an element. This may require some rebuilding of the page, but if the bg is important, it’s a good solution. You can apply a white bg color
4) Get rid of that background image altogether! I think the site would look pretty good without it.

The one suggestion I want to leave you with is to think like the elements. Learn what the elements + CSS can actually do and what they cannot! I had a lot of trouble early on trying to force HTML & CSS to work in a way they wouldn’t instead of having them work the way they do.

As for the height of #page being the same as the other container elements, it does this naturally if you don’t set a height for it and clear all your floats inside properly. Elements wrap their child elements naturally in the DOM. That’s just the way it works by default!