开发者

Mysterious padding around header

开发者 https://www.devze.com 2023-02-26 07:56 出处:网络
I have tested this in Google Chrome, IE, as well as Firefox and I am getting the strangest bug. I have made a horizontal list, and despite setting padding and margins to 0, I am still getting padding

I have tested this in Google Chrome, IE, as well as Firefox and I am getting the strangest bug. I have made a horizontal list, and despite setting padding and margins to 0, I am still getting padding above and to 开发者_如何学Gothe left of it.

It can be seen here:

http://dev.mcmodcenter.net/

CSS Source: http://pastebin.com/TJ6k1KwS


Those are body margins, which all browsers add by default.

You need to remove them from within your stylesheet, like so:

body {
    background: url('./bg.png');
    float: left;
    margin: 0;
}


The header div is fine.

You haven't set the margin on body, which gives you a default value (8px on my browser).

Set body's margin to 0 and you should be fine.


It is wise to always use a CSS reset style sheet. You can find one here => http://meyerweb.com/eric/tools/css/reset/.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号