f_olivere
f_olivere

Reputation: 93

Drawing a 2x2 grid using bootstrap

I'm trying to draw a 2x2 grid using bootstrap. My aim is to make a grid which looks similar to this:

Grid

with an onclick event handler on each tile. I'm having trouble setting the height of the tiles though and have something like this so far...

<div class="col-md-4">
  <div class="row">
     <div class ="col-md-2">
         one
      </div>
     <div class ="col-md-2">
        two
     </div>
  </div>
  <div class="row">
     <div class ="col-md-2">
         three
      </div>
     <div class ="col-md-2">
        four
     </div>
  </div>

Upvotes: 0

Views: 10758

Answers (1)

jmag
jmag

Reputation: 826

bootstrap columns should total to 12. The code:

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

Upvotes: 2

Related Questions