View Full Version : div bg 100% doesnt work when I add data..

08-05-2007, 07:03 PM
Hello, I use a div tag to place a background and I use height=100% to get it all the way down to the bottom of the page but if I add data such as tables with javascript the height wont update so the background doesnt continue all the way down.. It happens in both FF and opera but not in IE, is there a way to solve this?

08-05-2007, 07:18 PM
Most likely there are other factors. However, height=100% is technically invalid for a div in HTML, use style, or maybe you did, but that's not clear, and style="height:100%;" (in javascript: style.height='100%') is meaningless unless the element with it has a container element with a set height. IE is known for sometimes overlooking this fact and using either the viewport's (IE's window.clientHeight, other's window.innerHeight) or the page's (IE's and other's document.body or document.documentElement .scrollHeight or .offsetHeight) height. In any case, a link to the problem page would probably be required to get any real help on this.

08-07-2007, 02:04 PM
The thing is, I need the background to go all the way down and if I have the bg in the body tag like this:

body {
background-image:... ;

The logo that should be at the same position as the background move a little bit to the left on IE...

08-07-2007, 02:36 PM
I'd still like to see the page live to comment on this with anything nearing certainty. However, generally IE can be made to display as desired in a case like that by using an IE specific stylesheet.

08-07-2007, 02:41 PM
If you place

where 120px is the height of your background image, then it should work fine ?

08-07-2007, 04:54 PM
I added a style for IE only to solve it, it was the width that didnt match.