I ran into a situation where I was required not to limit the number of columns in a row since potentially multiple blocks of content would be added to the area from places in the admin.
By default BS3's behavior tells 12 column divs not to float which causes them to go over the top of the smaller floated divs. So I've written an override as a class for my system and thought I would share in case anyone else has the issue.
If anyone has a better idea or suggestion I would love to feel like I'm not hacking Bootstrap ... but here's how I solved it.
? /* 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>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…