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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mozilla 100% body width and height

Status
Not open for further replies.

TheDust

Programmer
Aug 12, 2002
217
US
It seems that when I set the width and the height of the BODY tag to 100%, Mozilla adds some extra padding no matter what to the screen, so that you still have extra room to scroll right and down. Why am I using a 100% width and height on the body? It's the best way I've found to get an absolutely centered design. Here's my test example:


Any ideas how I can eliminate the extra space that Mozilla inserts?
 
A height of 100% is not valid XHTML 1.0. I recommend you add a complete doctype to your webpage and then run it through the validator.

*cLFlaVA
----------------------------
"Holy crip he's a crapple!
 
tgreer - I tried your advice, but it doesn't seem to work. I have placed everything in a DIV with the style attribute set to "position:relative; margin:0 auto" and I have no size attributes assigned to the HTML or BODY tags:


I haven't found any working way of absolutely centering a layout than I've done so far where Mozilla is giving me the extra margins:


If anyone has any advice, let me know! Thanks!
 
I tried every single DOCTYPE mentioned on A List Apart ( and wrapping my content in a DIV with "position:relative; margin: 0 auto" still is not working:


Maybe there is no solution to this problem? I can't figure out any other way to absolutely center.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top