0

我希望垂直菜单完全位于左上角,但现在仍然有大约 2px 的顶部和左侧边距,我不知道为什么,所有边距都设置为 0。有人知道吗?

非常感谢!

4

5 回答 5

1

添加margin: 0px;到您的页面正文标记。

于 2012-07-19T17:04:13.697 回答
1

正文标签上设置了边距,请尝试:

body { margin:0; padding:0; }
于 2012-07-19T16:59:38.847 回答
1

You need to set margin: 0 on the body (live editing via Developer Tools solves it for me).

And learn to use Developer Tools ;)

Using Chrome, it showed me you had something like this:

body {
  display: block;
  margin: 8px;
}

from the user agent stylesheet.

于 2012-07-19T17:00:02.040 回答
0

你使用了一些 CSS 重置?如果没有,请使用: http: //meyerweb.com/eric/tools/css/reset/。或者,如果您想要更快的解决方案,请使用body {margin: 0; padding: 0;}

于 2012-07-19T16:59:12.367 回答
0

I'm guessing that there are still default margins on the page. Try using a CSS reset file. This will make sure that the margin and padding are all 0 when you start (along with some other nice resets).

于 2012-07-19T17:00:59.263 回答