Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap - 4 column grid

I can not get thet rows on the page. I'm always page halved into two horizontal section and I want four vertical sections.

Here is PICTURE: PICTURE:

Here is fiddle of my code that you can easy know that what I want FIDDLE.

I only need that middle content to be like on picture.. 4 vertical columns and in that columns that i have 2 blocks.

Here is my try :

<div class="col-md-12">
<div class="pane border-right">
<div>
<div style="float: left;">
</div>
</div>
<div class="col-md-6 specifica ">
<div class="col-sm-3 border-right-dotted">

a

</div>
<div class="col-sm-3 border-right-dotted">

b

</div>

</div>
<div class="col-md-3 specifica ">
<div class="col-sm-3 border-right-dotted">

c

</div>
<div class="col-sm-3 ">

d

</div>
</div>
like image 288
Smack Avatar asked Jan 25 '14 14:01

Smack


People also ask

How do I make 4 columns in Bootstrap?

First example: create a row ( <div class="row"> ). Then, add the desired number of columns (tags with appropriate . col-*-* classes). The first star (*) represents the responsiveness: sm, md, lg or xl, while the second star represents a number, which should always add up to 12 for each row.

How do I make 5 columns in Bootstrap 4?

Populate the 'row' div with 5 divs with class 'col'. Because Bootstrap 4.0+ grid system has now shifted to Flexbox, the columns will arrange by themselves into five equally sized DOM elements.

How do I make 3 columns in Bootstrap 4?

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.

What is Bootstrap 4 grid?

Bootstrap 4 Grid System Bootstrap's grid system is built with flexbox and allows up to 12 columns across the page. If you do not want to use all 12 columns individually, you can group the columns together to create wider columns: span 1. span 1.


1 Answers

With this code you can create 2 rows with 4 columns like the picture, example: http://jsfiddle.net/ignaciocorreia/rc2E7/1/

<div class="row">
    <div class="col-sm-3 col-md-3">a</div>
    <div class="col-sm-3 col-md-3">b</div>
    <div class="col-sm-3 col-md-3">c</div>
    <div class="col-sm-3 col-md-3">d</div>
</div>

----

<div class="row">
    <div class="col-sm-3 col-md-3">a</div>
    <div class="col-sm-3 col-md-3">b</div>
    <div class="col-sm-3 col-md-3">c</div>
    <div class="col-sm-3 col-md-3">d</div>
</div>

EDIT - 07-04-2017

With Boostrap 4 and flex box things change to:

<div class="row">
   <div class="col">1</div>
   <div class="col">2</div>
   <div class="col">3</div>
   <div class="col">4</div>
</div>

Working example: https://codepen.io/igcorreia/pen/jBjbQP

like image 183
Ignacio Correia Avatar answered Sep 29 '22 08:09

Ignacio Correia