...

View Full Version : how to make divs fill browser?



emerald511
09-13-2007, 04:03 AM
I am trying to make a top bar div of a different color that stretches over the whole browser. However, just creating the div keeps a small border around the top and sides of the div. Is there any way to extend the div so those gaps aren't there?

abduraooft
09-13-2007, 04:37 AM
Give width and height as 100%, but this will be the 100% of its container.

jlhaslip
09-13-2007, 04:49 AM
Without seeing your cde, it is difficult to say for certain what might be happening, but use the 'star' selector hack and set the margins and padding to zero for the html element and those spaces should (maybe) go away.


* html {
margin:0;
padding:0;
}

Try it and let us know it that works.

Also, eliminate all the margins and padding for the <hx> elements in that div...

emerald511
09-13-2007, 05:25 AM
oooh yeah setting the margin of the body to 0 seems to work! thanks!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum