【问题标题】:body tag margin creating bad whitespace up top正文标签边距在顶部创建错误的空白
【发布时间】:2014-04-22 09:42:19
【问题描述】:

我无法摆脱页面顶部 body 标记上的白边。我将添加必要的 .body 格式,但它仍然存在,并且我的检查器由于某种原因仍然显示默认的 8px 填充。为什么身体不会捡起这个?

@import "bootstrap";
@import url(http://fonts.googleapis.com/css?family=Lato|Open+Sans+Condensed:300);


.body {
    margin:0px;
}

.container-top {
    text-align: center;
    font-family: 'Open Sans Condensed', sans-serif;
    background-color: #424b51;
    font-size: 25px;
}

【问题讨论】:

    标签: html css twitter-bootstrap twitter-bootstrap-3


    【解决方案1】:

    您应该删除点“。”来自身体。

    body {
      margin: 0;
    }
    

    【讨论】:

    • 谢谢! Duhhhhhh,我的错!
    【解决方案2】:

    从正文前删除点。

    body{
    margin:0;
    padding:0;
    }
    

    【讨论】:

      猜你喜欢
      • 2012-08-08
      • 2022-11-02
      • 1970-01-01
      • 1970-01-01
      • 2015-09-16
      • 1970-01-01
      • 2016-03-22
      • 1970-01-01
      相关资源
      最近更新 更多