I'm using flexbox to align items and am struggling with top-aligning multiline text to the bottom of its parent div. I've seen examples where a button has been aligned to the bottom of its parent, but not achieving the same effect with multiple lines of text in each item.
Here is what I'm trying to accomplish:
Here's what I have accomplished with the code below:
Here's my code:
.team {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.li {
width: 25%;
padding: 10px;
display: flex;
flex-direction: column;
}
.expert-wrap {
margin-top: auto;
}
<ul class="team">
<li>
<div class="thumb">Image</div>
<div class="excerpt">Some text</div>
<div class="expert-wrap">
<div class="expertise-keywords">Expertise:
<?php the_field('expertise'); ?>
</div>
<?php } ?>
</div>
</li>
</ul>
Ideally, I want to align the text at the top, but everything I've tried - including applying align-self: flex-end on that expert-wrap div - aligns the bottom line of text vs the top line of text. Any ideas on how I can get the items inside that bottom div aligned at the top, while also being aligned to the bottom of the parent?
I'm so stumped on this. Appreciate any advice. -Nat