tags:

views:

28

answers:

1

hi,every one

when I use static or relative position,there is always about 5 pixel white space between the div element and the browser window border.following is my code

#top{
  background:#011961;
  height:75px;
  color:white;
}

I want to set the distance between the div element and the browser window border to 0 using static or relative position,but not fixed or absolute position.

Is it possible? any suggestion is appreciated.

+1  A: 

Use a universal reset..

* { margin:0; padding:0; }

There's usually margin/padding on the body element which creates that space, this'll explicitly set it on all elements. Another alternative if you care about leaving form controls as they are is to use a reset.css.

meder
sorry,but after I add margin:0; padding:0;,the space still exists.
gbstack
Did you paste what I literally typed? `*` literally. And please link to the code.
meder
Thank you very much! it works.it's my fault that I didn't use * { margin:0; padding:0; }but use#top{margin:0;padding:0;}
gbstack