chromedome
chromedome

Reputation: 47

How to make nested divs in a bootstrap column side by side?

In my grid, inside a column, I have 2 divs which are both inline-block. The problem is that when text is long, it shifts to the left side and is not aligned properly. I even tried changing it from inline-block for both divs to float: left but it doesnt make a difference.

I want it aligned like the 2 columns to the right, but once text gets long, it doesnt wrap, but gets shifted. demo

Demo with html5: http://codepen.io/anon/pen/OPRwPr

html:

    <header>
</header>
<main class="contain">
  <div class="row">
    <div class="col-1-3">
      <div class="title px30 lh60 pad-left-hard">
        Some Title
      </div>
      <div class="content pad-left-hard">
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut eos doloribus ea enim, iure porro inventore, architecto illum accusamus, esse modi. Laudantium iure deleniti, earum ducimus, ullam reprehenderit rerum. Nemo.
        </p>
      </div>
    </div>
    <div class="col-1-3">
      <div class="title px30 lh60 pad-left-hard">
        Some Title
      </div>
      <div class="content pad-left-hard">
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut eos doloribus ea enim, iure porro inventore, architecto illum accusamus, esse modi. Laudantium iure deleniti, earum ducimus, ullam reprehenderit rerum. Nemo.
        </p>
      </div>
    </div>
    <div class="col-1-3">
      <div class="title px30 lh60 pad-left-hard">
        Some Title
      </div>
      <div class="content pad-left-hard">
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut eos doloribus ea enim, iure porro inventore, architecto illum accusamus, esse modi. Laudantium iure deleniti, earum ducimus, ullam reprehenderit rerum. Nemo.
        </p>
      </div>
    </div>
  </div>
</main>
<footer>

</footer>

css:

body {
    margin: 0;
    padding: 0;
}

.splash-container {
    position: relative;
  display: none;
    width: 100%;
    height: 10px;
    background-size: cover;
    background-image: url("../img/clouds.jpg");
}

.menu-container {
    height: 50px;
    //background: #2B2B2B;
    position: fixed;
    top: 0;
    z-index: 1;
    width: 100%;
}

.splash-logo {
    height: 400px;
}

.splash-image-container {
    position: absolute;
    width: 100%;
    height: 200px;
    text-align: center;
}

.main-points {
    min-height: 450px;
    background: #222;
    padding: 75px;
}

.points-container {
    width: 100%
}

.points-icon {
    display: inline-block;
    color: #069076;
    vertical-align: top;
}

.points-text {
    vertical-align: top;
    display: inline-block;
    color: white;
    padding: 3px 0px 0px 20px;
}

.points-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.points-desc {
    font-size: 14px;
    margin: 0;
    padding: 0;
    color: #999;
}

Upvotes: 0

Views: 1225

Answers (2)

Vitorino fernandes
Vitorino fernandes

Reputation: 15951

demo - http://codepen.io/anon/pen/vEXazb

Add pull-left class for .points-icon and display-table:cell for .points-text

Upvotes: 1

s0rfi949
s0rfi949

Reputation: 387

Adding float: left; to .points-icon and

display: block; to .points-text gave me this CodePen.

Not sure if that is exactly what you're looking for...

Upvotes: 0

Related Questions