Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firefox Ignoring Height

Status
Not open for further replies.

BoulderBum

Programmer
Jul 11, 2002
2,179
US
This is driving me nuts.

I have a div with style.height set to 100%. It works fine with IE and with FireFox until I introduce a DOCTYPE:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">

After that, the DIV goes nuts and ignores the height I set for it.

Here's the thing, I set the html and body tags both to have heights of 100%; if I set the background color of the body, I can see that it does indeed fill the page (though the div does not).

Oh, and if I remove the DOCTYPE, it works with FireFox, but not in IE. Arrrggg!

Any ideas?
 
Thanks for the replies.

Foamcow, I actually read that and, as noted, the body and html elements both have heights set to 100%: that's what's driving me nuts! It still doesn't work!

cLFlaVA, I actually had a more complete doctype, but ended up changing in in my experimentations (in fact, I think I ripped my latest doctype off from the article Foamcow linked to).

Any other ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top