Just getting started with Bootstrap and facing a challenge related to vertical alignment using the grid system. Looking for some expert guidance and assistance in finding a solution.
To help explain the issue better, I have captured 4 screenshots (links provided below) showcasing scenarios for lg, md, sm, and xs. Hoping these images will give you a clear idea of the problem.
The main issue is that while everything looks aligned perfectly in the lg scenario, as the viewport size changes, misalignment starts appearing between the content in the 2 columns.
Below is the HTML markup:
<div class="container">
<div class="row row-centered">
<div class="col-sm-6 col-md-6 col-lg-6">
<div class="row row-centered">
<div class="hidden-xs hidden-sm hidden-md hidden-lg"></div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<h2>HEADER NUMBER 1</h2>
</div>
<div class="hidden-xs hidden-sm hidden-md hidden-lg"></div>
</div>
<div class="row row-centered">
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"></div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
<div>
<p>Teaser number 1 - Lorem ipsum dolor sit, interdum consectetur elit. Donec interdum dapibus lectus rhoncus.</p>
</div>
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"></div>
</div>
<div class="row row-centered">
<div class="col-sm-6 col-md-6 col-lg-6">
<img class="img-responsive" src="http://placehold.it/200x200&text=Square" alt="">
<h4>Sub-heading short</h4>
</div>
<div class="col-sm-6 col-md-6 col-lg-6">
<img class="img-responsive" src="http://placehold.it/200x200&text=Square" alt="">
<h4>Sub-heading longer</h4>
</div>
</div>
<div class="row row-centered">
<div class="col-lg-12">
<div>
<p>Link to detailed page 1</p>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-md-6 col-lg-6">
<div class="row row-centered">
<div class="hidden-xs hidden-sm hidden-md hidden-lg"></div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<h2>HEADER DIFFERENT LENGTH</h2>
</div>
<div class="hidden-xs hidden-sm hidden-md hidden-lg"></div>
</div>
<div class="row row-centered">
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"></div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
<div>
<p>Teaser number 2 - Lorem ipsum dolor sit amet. Donec interdum dapibus lectus eu rhoncus.</p>
</div>
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"></div>
</div>
<div class="row row-centered">
<div class="col-sm-6 col-md-6 col-lg-6">
<img class="img-responsive" src="http://placehold.it/200x200&text=Square" alt="">
<h4>Sub-heading different</h4>
</div>
<div class="col-sm-6 col-md-6 col-lg-6">
<img class="img-responsive" src="http://placehold.it/200x200&text=Square" alt="">
<h4>Sub-heading 4</h4>
</div>
</div>
<div class="row row-centered">
<div class="col-lg-12">
<div>
<p>Link to detailed page number 2</p>
</div>
</div>
</div>
</div>
</div>
</div>
No custom CSS has been implemented yet except for the .row-centered class which aligns text to the center like this:
.row-centered {
text-align:center;}
Any suggestions on how to resolve this issue would be greatly appreciated. Thank you!
Screenshots: Example