Bootstrap - 移动设备上的某种边距(仅右侧)

Tor*_*ben 11 css twitter-bootstrap

我创建了一个带引导程序的移动页面,但是对于某种类型,移动页面在我可以滑动到的右侧的移动设备上有一个边距或填充.我删除了一些代码,但即使是最简单的结构也有:

    <div class="container">
        <div class="row">
          <div class="col-lg-12">
            <div class="navigation"></div>
          </div>
        </div>
    </div><!--container-->

.container {
  max-width:100%;
  padding:0;
  height: 100%;
  width:100%;
}

.navigation {
  height:3.4375em;
  line-height:1em;
  background-color:#E75200;
}
Run Code Online (Sandbox Code Playgroud)

我在这里上传了测试页面:http: //wp1011618.server-he.de/projekte/test/index2.html

我觉得这是因为col-lg-12填充,但Bootstrap这不能成为Bootstraps的意图,所以我想知道这里有什么不对吗?

谢谢!

Tor*_*ben 39

我想到了:

html, body {
  overflow-x: hidden;
}
Run Code Online (Sandbox Code Playgroud)

为我解决了!

  • 你知道为什么会发生这种情况吗?我遇到了同样的问题(仅在移动设备上)并且此修复有效。我忍不住想知道为什么,以前没有发生过。 (3认同)

小智 7

.col-lg-12类有padding-right: 15px;padding-left: 15px;,这会导致空格。使它们为 0,而不是在.row类中删除margin-right: -15px;和。margin-left: -15px;