我是一个bootstrap新手用户,所以如果这是一个愚蠢的问题,我很抱歉! 我正在尝试关闭最后一个 col 的背景,但我无法做到这一点。 你可以看到图片;我想隐藏红色矩形上方的灰色..
以下是代码:
<div class="row">
<div class="col-lg-11 col-lg-offset-1">
<div class="row">
<div class="col-lg-11 news">
<h2>NEWS</h2>
</div>
</div>
<div class="row news">
<div class="col-lg-3">
<h3>Title</h3>
</div>
<div class="col-lg-4">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="col-lg-4">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="col-lg-1"></div>
</div>
</div>
</div>
Here is the code on an online editor
提前谢谢!
答案 0 :(得分:1)
所以,如果你想隐藏那个小小的白色区域
将col-lg-11
更改为col-lg-12
:
<div class="col-lg-12 news">
<h2>NEWS</h2>
</div>
答案 1 :(得分:1)
为什么不填补空间?
<div class="col-lg-12 news"> <h2>NEWS</h2> </div>
答案 2 :(得分:0)
可能是这样的:
<div class="col-lg-1 no-background"></div> // added class
CSS:
.no-background { background: none; }
答案 3 :(得分:0)
我解决了编辑“母亲”-row列及其嵌套项目的数量:http://www.bootply.com/vcMjA3iMA5