donfrigo donfrigo - 7 months ago 23
HTML Question

Bootstrap grid and row alignment issue

I am trying to achieve the following layout as shown on the picture:enter image description here

I would like both col-xs-8 and col-xs-4 to start at the very same height, so I have put them in one row, and the lower col-xs-8 to an other one. What I get is the following:
enter image description here

Is there any way to get around this problem and display both columns properly? I would also like both columns to be exactly the same height. The lower col-xs-8, has a fixed height. Thank you!

Roy Roy
Answer

Add pull-right class to the second element.

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
  <div class="col-xs-4 bg-warning">Lorem Ipsum is simply dummy text.</div>
  <div class="col-xs-8 bg-primary pull-right">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>
  <div class="col-xs-4 bg-success">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>
</div>