html - 页眉和页脚有白色边框?

标签 html css

我知道这样的问题一直被问到,我很抱歉再次问这个问题,但我似乎无法自己解决这个问题。我正在尝试添加页眉和页脚,我终于做到了,所以它们的位置正确,但它们并没有填满整个区域,而是被白色包围。我该如何解决这个问题?

https://codepen.io/jaydotxxx/pen/yOvLyv

# container {
  margin: 0 auto;
  padding:40px;
}

#header {
  z-index:0;

    height: 30px;
    background-color: black;
}
#footer {
  z-index:2;
    height: 30px;
    width:100%;
    padding:0px;
    position: relative;
    bottom: 0;
    background-color: black;
}
#image {
  z-index:1;
  height:1000px;
  width:100px;
  margin:20px auto;

  padding:50px;
  background-color:red;

}

最佳答案

我认为您正在寻找类似的东西:

body {
  margin: 0;
}

关于html - 页眉和页脚有白色边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36522689/

相关文章:

javascript - Twitter处理链接的方式: click then AJAX,打开一个新选项卡然后完全加载

javascript - 如何阻止谷歌验证码执行?

jquery - 对搜索结果的查询集进行排序并通过 ajax 返回

JavaScript 缩小 HTML 正则表达式

css - 仅包含 font-awesome 的一部分

javascript - 尝试通过滚动更改沿 DOM 的元素位置时,jQuery .detach() 不起作用

python - 属性错误 : module 'request' has no attribute 'urlopen'

javascript - 仅使用 CSS 关闭模式

javascript - 悬停时更改边距会移动其下方的所有内容

CSS/SVG 动画效果 - 三个弹跳方 block - 正确的时间