I'm trying to create a column layout with in each column a title, a piece of text of unequal height and a button. My goal is to let all elements starts on the same height. The struggle is how to achieve this, especially with the last button. Using display: flex
, I can create equal-height columns but this does not apply to the inner elements.
I have created a simple structure in this codepen: https://codepen.io/michaaeell/pen/gOxWWGZ. My goal is to let the titles, texts and final sentences start equally, so basically responsive whitespace must be added to column 1 and 2 above the final sentence to ensure it gets on the same height as the final sentence of column 3.
I have tried to achieve it using flex-grow, flex-flow, align-content but they all lead to incorrect results... any help is greatly appreciated!
.container {
display: flex;
}
.column {
flex: 1;
border: 1px solid red;
}
<div class="container">
<div class="column">
<h2> Some title </h2>
<p> "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam </p>
<p> Final sentence </p>
</div>
<div class="column">
<h2> Some title </h2>
<p> "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam </p>
<p> Final sentence </p>
</div>
<div class="column">
<h2> Some title </h2>
<p> "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad minim veniam </p>
<p> Final sentence </p>
</div>
</div>