View Full Version : how to make divs fill browser?

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?

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

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 {

Try it and let us know it that works.

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

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