0

Codepen to demonstrate what I'm talking about:

http://codepen.io/anon/pen/dGopxL

Is there a way to make the second column (red background) always be the same height as the first column?

Making the height 100% doesn't work because I never set a fixed height, so I'm not sure how else to do it. I could use Javascript/jQuery to set them equal to each other and to continually update it whenever the page is resized, but I'd like to do it without JS if possible.

Any tips?

Here is the code from the Codepen:

.container {
  width: 800px;
  margin: 0 auto;
  background-color: #EEE;
}
div {
  display: inline-block;
}
.col1 {
  width: 50%;
}
.col2 {
  background-color: tomato;
  width: 50%;
  text-align: center;
  vertical-align: top;
}
<div class="container">
  <div class="col1">
    <img src="http://placecage.com/400/400">
  </div>
  <div class="col2">
    <p>Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum
      Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum</p>
  </div>
</div>
j08691
  • 204,283
  • 31
  • 260
  • 272
ClaytonAlanKinder
  • 313
  • 1
  • 3
  • 15

0 Answers0