我遇到了一种情况,我要求不要限制连续的列数,因为可能会将多个内容块从管理员的地方添加到该区域。Bootstrap 3 - 连续超过12列
默认情况下,BS3的行为告诉12列div不要浮动,这会导致它们越过较小的浮动div顶部。所以我写了一个覆盖作为我的系统的类,并认为我会分享以防其他人遇到问题。
如果任何人有更好的主意或建议,我会喜欢觉得我不是黑客Bootstrap ...但这是我如何解决它。
/* col-xs float fix for large column groups */
.large-group .col-xs-12 {
float: left;
}
/* col-sm float fix for large column groups */
@media (min-width: 768px) {
.large-group .col-sm-12 {
float: left;
}
}
/* col-md float fix for large column groups */
@media (min-width: 992px) {
.large-group .col-md-12 {
float: left;
}
}
/* col-lg float fix for large column groups */
@media (min-width: 1200px) {
.large-group .col-lg-12 {
float: left;
}
}
<div class="container">
<div class="row large-group" style="background-color:#ebebeb;">
<div class="col-xs-9"><div style="background-color:#babeee;"><p>col 9</p></div></div>
<div class="col-xs-3"><div style="background-color:#fefeeb;"><p>col 3</p></div></div>
<div class="col-xs-12"><div style="background-color:#bada55;"><p>col 12</p></div></div>
</div>
</div>
把你的代码放在“代码”中 – LorDex 2014-10-31 16:26:50