Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3 column issue

I'm working with bootstrap 3, and am new to it but it seems like a fairly simple transition from 2.

Here is the jsfiddle with the code: http://jsfiddle.net/AHvLW/

And here is an image of how it renders when they are all in col-md-4:

I don't get it though, it works fine in jsFiddle, but not on my index file. Anyone experience a similar issue of might know whats up with it?

like image 564
BrettD Avatar asked Aug 30 '13 00:08

BrettD


People also ask

Does Bootstrap have 3 equal columns?

Three Equal ColumnsUse the . col class on a specified number of elements and Bootstrap will recognize how many elements there are (and create equal-width columns). In the example below, we use three col elements, which gets a width of 33.33% each.

Why is Bootstrap 4 better than Bootstrap 3?

While Bootstrap 3 provided Skip navigation, Nested headings, and color contrast, Bootstrap 4 has improved the accessibility with its components. Styling and layout from version 4 can be applied to a wide range of markup structures.

Can I use Flexbox with Bootstrap 3?

Bootstrap 3 used floats to handle the layout in place of the flexbox, however, Bootstrap 4 uses flexbox to handle the layout. The flexbox layout makes it easier to design a flexible responsive layout structure without using float or positioning.


1 Answers

Since the columns are not all equal in height you need to add a clearfix <div> for the large viewports just as the new row should start, that is between your 3rd and 4th column:

<div class="row">
    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">...</div>
    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">...</div>
    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">...</div>

    <!-- Add the extra clearfix for only the required viewport -->
    <div class="clearfix visible-md visible-lg"></div>

    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">...</div>
    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">...</div>
    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">...</div>
</div>

Demo fiddle

like image 98
omma2289 Avatar answered Sep 23 '22 06:09

omma2289