Currently, I am working on a layout design using Bootstrap 3 that involves eight text divs. These divs have almost the same height, but some are slightly taller depending on the screen width.
My goal is to arrange them into three columns on desktop and then shrink them into two columns on smaller screens.
What I Have Attempted
I tried setting each div to col-xs-6 and col-md-4. However, this caused gaps in some 'cells' on desktop view.
I also tried wrapping each set of three divs in a
.row
which fixed the desktop issue but created a new problem on mobile devices.Adding a clearfix div that is visible-md did not solve the problem either.
Can someone help me figure out how to make the following code display in three equal columns on desktops and two equal columns (without gaps) on mobile devices?
<div class="row">
<div class="col-xs-6 col-md-4">
<h4><a href="#bond">text text</a></h4>
<p class="subtitle">Managing Director</p>
</div>
<div class="col-xs-6 col-md-4">
<h4><a href="#buffa">text text</a></h4>
<p class="subtitle">Managing Director</p>
</div>
<div class="col-xs-6 col-md-4">
<h4><a href="#ebert">text text</a></h4>
<p class="subtitle">Managing Director</p>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-4">
<h4><a href="#gale">text text</a></h4>
<p class="subtitle">Chief Accounting Officer</p>
</div>
<div class="col-xs-6 col-md-4">
<h4><a href="#kleinman">text text</a></h4>
<p class="subtitle">General Counsel & Managing Director</p>
</div>
<div class="col-xs-6 col-md-4">
<h4><a href="#scarpati">text text</a></h4>
<p class="subtitle">Chief Compliance Officer</p>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-4">
<h4><a href="#selinger">text text</a></h4>
<p class="subtitle">Managing Director</p>
</div>
<div class="col-xs-6 col-md-4">
<h4><a href="#tareke">text text text</a></h4>
<p class="subtitle">Managing Director</p>
</div>
</div>