
Ok but why would I have to put a pixel value for the header instead of a %?
When I use % for the header the whole page goes white on firefox and on IE everything messes up with xhtml. But with the px everything appears perfect O.o lol I'm so lost.
Waz ;]
I never seem to experiance problems using %..
Erm, using percentages in XHTML? Sure I don't see why you can use it in context.. but I mean when it comes to CSS yes you're also allowed on a number of things - but it's not a matter of can XHTML or can HTML, but can CSS, which it can. I personally don't use percentages for heights, more so widths, because if you've got an element directly in the body that is height 100% and you want it to cover the entire screen, it will not do so - simply because body and the html elements aren't 100% to start with, to get around this you can use something like.
That will produce a 100% width and height, full-body. I might also add some browsers may not have by default the width 100% on html, and body so you might want to add that too but I wouldn't worry. The Margin is there to remove the default styling of most broswers, as for border that's to remove the border in IE6. Again I don't really advise percentages in heights unless you've got a fixed height container, but I guess it goes for your situation.Code:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <link href="styles/style.css" rel="stylesheet" type="text/css"> <title>Site Name - Site Slogan</title> <style type="text/css"> html, body { height: 100%; overflow: auto; margin: 0; border: 0; } #full-body { width: 100%; height: 100%; background-color: #ccc; } </style> </head> <body> <div id="full-body"></div> </body> </html>
Last edited by Iszak; 18-11-2008 at 01:14 PM.
Yeah I understand what u mean
Thanks,
Waz ;]
Want to hide these adverts? Register an account for free!