mod geek
mod geek

Reputation: 310

How To Use Bootstrap Nested Column Grid

I have tried to achieve bootstrap nested column div but this is not responsive I want to achieve the fully responsive grid system In BootStrap

this is what i want to achieve in bootstrap grid systemBootStrap Grid System

This is my html markup

<div class="col-md-12 topSpace">
   <div class="col-md-3 text-center"></div>
   <div class="col-md-6 text-center">
   </div>
   <div class="col-md-3 text-center">
   </div>
</div>
<div class="md-col-6 col-centered"></div>

this is the css markup

.col-centered{
margin:0 auto;
}

.topSpace{
top:100px;
}

Upvotes: 3

Views: 418

Answers (3)

Anoop John
Anoop John

Reputation: 464

This below html markup should work.

<div class="col-md-12">

  <div class="row">
    <div class="col-md-3">
      1
    </div>    
    <div class="col-md-6">
      2
    </div>    
    <div class="col-md-3">
      3
    </div>
  </div>

  <div class="row">
    <div class="col-md-6 col-md-offset-3">
      4
    </div>
  </div>

</div>

Demo: http://bootply.com/SJ3EYuxOQM

Upvotes: 6

Can Guney Aksakalli
Can Guney Aksakalli

Reputation: 1330

Another alternative to @John's answer is

<div class="col-md-12">

  <div class="col-md-3">
     1
  </div> 
  <div class="col-md-6">

    <div class="row">       
      <div class="col-md-12">
        2
      </div>
      <div class="col-md-12">
        4
      </div>
    </div>

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

</div>

It differs how the items are listed for smaller screen width:

  • For my answer: 1,2,4,3
  • For @john's answer: 1,2,3,4

Upvotes: 2

Prabhat-VS
Prabhat-VS

Reputation: 1530

This one also work try It,

<form class="form-horizontal" role="form">
    <div class="form-group">
        <div class="col-md-3">
            DIV1
        </div>
        <div class="col-md-6">
            DIV2
        </div>
        <div class="col-md-3">
            DIV3
        </div>
    </div>

    <div class="form-group">
        <div class="col-md-6 col-md-offset-3">
            DIV4
        </div>
    </div>
</form>

Upvotes: 1

Related Questions