Chad J Treadway
Chad J Treadway

Reputation: 422

Bootstrap and 1 px height on col - why?

Can someone explain to me why BS has a 1px height set by default? IT was this way in 2 and 3 and I never understood why? I know it says in the comments "Prevent columns from collapsing when empty" but what browsers does it do this?

Upvotes: 10

Views: 8878

Answers (2)

Daniel Dewhurst
Daniel Dewhurst

Reputation: 2593

// Prevent columns from collapsing when empty
min-height: 1px;

Source: http://getbootstrap.com/css/#grid

Upvotes: 0

Bass Jobsen
Bass Jobsen

Reputation: 49054

Try and you will know: http://bootply.com/82722

<div class="container" style="background-color:orange;">
    <div class="row">
    <div class="col-sm-6" style="background-color:blue;"></div>
    <div class="col-sm-6" style="background-color:red;">right</div>
    </div>
</div>
<div class="container" style="background-color:orange;">
    <div class="row">
    <div class="col-sm-6" style="background-color:blue;min-height:0"></div>
    <div class="col-sm-6" style="background-color:red;">right</div>
    </div>
</div>

Upvotes: 7

Related Questions