【发布时间】:2014-01-18 14:30:16
【问题描述】:
您好,我正在尝试将我的 Jumbotron 修复为屏幕全宽,但不知何故它需要 15px padding-left, padding-right。如果我删除填充,水平滚动条会出现30px right margin。我正在使用默认的 Bootstrap 版本 3.0.3 和默认的 VS2013 布局。按照这个link我删除了所有.container之外的Jumbotron我的页面看起来像这样
<body>
<div class="navbar navbar-inverse navbar-fixed-top">.... Navigation stuff</div>
<div class="jumbotron specialjum">
<div class="over container body-content">
....page headers and other stuff
</div>
</div>
<p class="just container body-content">
... body text
</p>
</body>
/////////////////////////////////////// //
body {
padding-top: 50px;
padding-bottom: 20px;
/*background:url("../Images/ps_neutral.png") repeat;*/
}
/* Set padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
.just {
text-align: justify;
}
.specialjum {
background: url('http://fc00.deviantart.net/fs70/i/2013/339/7/1/princess_kenny_korosu_by_theshadowstone-d6wu2zo.png') center;
color:#fff;
background-size: cover;
}
编辑: Firefox + Chrome + IE10 结果 ===|=================|===
关于如何修复布局的任何想法?我没有接触过使用 Nuget 更新的 Bootstrap CSS。
【问题讨论】:
-
您是否尝试将
container-fluid类添加到 jumbotron div 中? -
我试过它不工作。
-
.container-fluid 不在 3.0.3 中,在 3.1.0 中
-
也可以在不同的浏览器中查看您的页面。它可能是您正在使用的任何浏览器添加的一些默认标记,尽管 bootstrap 3 中的 normalize.css 文件应该负责这一点。
-
@Jerreck 在所有浏览器中都一样,看看我的编辑,看看发生了什么。
标签: html css twitter-bootstrap twitter-bootstrap-3