Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get these bootstrap columns to stack on top of each other?

I'm making a cheat-sheet with panels wrapped in size 6 columns, they are all part of the same row.

The problem I'm having is that I want the third column in the row to sit directly underneath the first one.

Instead it behaves 'properly' and forms a second aligned row, where the there is a gap between the first two elements and the row below.

enter image description here

How can I get the third panel to sit flush against the panel above it?

like image 349
Matthew Rathbone Avatar asked Feb 09 '16 03:02

Matthew Rathbone


People also ask

Can you nest columns in Bootstrap?

You can nest columns once you have a container, row, and column set up. To do this, add a new row <div> within the parent column's code, then add your nested columns.

What is stacked in Bootstrap?

Stacks offer a shortcut for applying a number of flexbox properties to quickly and easily create layouts in Bootstrap. All credit for the concept and implementation goes to the open source Pylon project.

How can I make Bootstrap 4 columns all the same height?

You just have to use class="row-eq-height" with your class="row" to get equal height columns for previous bootstrap versions.

How do I align columns in Bootstrap?

To horizontally align columns, we can use the justify-content classes. justify-content-start left align the columns. justify-content-center center aligns the columns. justify-content-end right align the columns.


1 Answers

You can have the rows inside the columns, instead of the columns inside a row. See https://jsfiddle.net/mendesjuan/89t1g002/1/

<div class="row">
  <div class="col-md-6">
    <div class="panel">Content  </div>
    <div class="panel">Content </div>
  </div>
  <div class="col-md-6">
    <div class="panel">Content</div>
    <div class="panel">Content</div>
  </div>
</div>
like image 180
Juan Mendes Avatar answered Sep 28 '22 14:09

Juan Mendes