Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 326
Chad J Treadway Avatar asked Sep 23 '13 19:09

Chad J Treadway


People also ask

How does Bootstrap use height and width?

Width and Height Utilities The width and height can be set for an element, by using 25%, 50%, 75%, 100%, and auto values. For instance, use w-25 (for remaining values, replace 25 with those values) for width utility and h-25 (for remaining values, replace 25 with those values) for height utility.

How do I make Bootstrap 100% width?

If you want to have a true 100% width element, simply put a w-100 class on your div without container . In your case, when you are using a container , switch it to a fluid one by replacing it with container-fluid , and adding a p-0 class as well.

What is Col 12 Bootstrap?

the numbers (1-12) represent a portion of the total width of any div. all divs are divided into 12 columns. so, col-*-6 spans 6 of 12 columns (half the width), col-*-12 spans 12 of 12 columns (the entire width), etc.

What does just the Col class mean in Bootstrap?

Use the . col class on a specified number of elements and Bootstrap will recognize how many elements there are (and create equal-width columns).


1 Answers

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>
like image 105
Bass Jobsen Avatar answered Oct 13 '22 10:10

Bass Jobsen