什么导致顶部和底部的空白?

pmc*_*lee 0 html css

为我的背景图像添加新的div类后,顶部,底部和页面菜单变为白色. style.css文件

#boundless{
  background-image:url('http://thehypebr.com/wp-content/uploads/2010/09/boundless-sem-branco-2.jpg');
  background-repeat:no-repeat;
  background-attachment:fixed;
  line-height:20px;
  font-size:14px;
  font-family:"Trebuchet MS"; 
  margin:0
}
Run Code Online (Sandbox Code Playgroud)

的index.php

<body>
    <div id='boundless' onclick='window.location.href="http://boundlessny.com/clothing"'>
Run Code Online (Sandbox Code Playgroud)

Lek*_*eyn 5

使用Firebug,我发现问题是由style.css中的第16行引起的:

margin:165px auto 20px;
Run Code Online (Sandbox Code Playgroud)

如何调试此类问题:

  1. 考虑可能的原因,在以下各项之后重复此步骤.
  2. 打开Firebug,打开有问题的部分(在本例中为空白底部)的上下文菜单,然后选择 Inspect Element
  3. 将鼠标悬停在节点上以查看哪个位置覆盖了出现问题的位置.我现在感觉可能的原因是不正确使用边距,填充或宽度.
  4. 通过查看右侧窗格,选项卡来隔离CSS /元素Style.如果需要,请展开节点.
  5. 禁用或更改CSS属性的值以查看它是否确实导致了问题.