我希望垂直菜单完全位于左上角,但现在仍然有大约 2px 的顶部和左侧边距,我不知道为什么,所有边距都设置为 0。有人知道吗?
非常感谢!
添加margin: 0px;
到您的页面正文标记。
正文标签上设置了边距,请尝试:
body { margin:0; padding:0; }
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.
你使用了一些 CSS 重置?如果没有,请使用: http: //meyerweb.com/eric/tools/css/reset/。或者,如果您想要更快的解决方案,请使用body {margin: 0; padding: 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).