...

View Full Version : zero space between DIV and top of page,,



muhaidib
12-05-2005, 05:55 PM
hey all :)

how do you make a DIV square touch the top of the page,, so there is no empty space between the top edge of the DIV square and the top edge of the page??

thanks in advance :)

_Aerospace_Eng_
12-05-2005, 06:01 PM
Add this in between your head tags

<style type="text/css">
html, body {
margin:0;
padding:0;
}
</style>

muhaidib
12-05-2005, 11:58 PM
thanx,,, actually i figured it out,,


its suppose to be


margin-top: -10px;

thanx anyways :)

mark87
12-06-2005, 12:10 AM
Did you put a 10px margin on your div by any chance? :p

muhaidib
12-06-2005, 05:29 PM
no i left it as default

nut the browser keeps a 10 pix margin,,, so i had to put a (-10) margin to make zero lol

mark87
12-06-2005, 05:40 PM
Do you have a link by any chance? Because what Aerospace said should work fine.

SpirtOfGrandeur
12-06-2005, 05:42 PM
-10 margins will not work on all browsers for each browser defines Their default HTML/BODY padding differently.

evo
12-07-2005, 04:43 PM
Just having margin: 0px on the body element will do that. You may mash up how it displays on non-ie browsers.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum