Scenario :
- I'm creating a pricing comparison table and am having difficulties aligning the last div,
card-vat-fee
, to the bottom of the container. - I need to do this because the tiers have longer running lists than one another, causing the last div isn't aligned with the bottom of the container.
- How can I get the last div to align to the bottom of the flexbox?
Tried Case :
- Of course, if I set a
min-height: 320px;
on thecard-vat-fee
class it will align the div to the bottom, however this isn't a responsive solution and I feel like there is a better approach that usesflex
properties. Moreover, setting thecard-vat-fee
div to flex-grow,flex: 1 1 auto
, produces an unideal solution.
Code :
<div class='pricing__tier'>
<div class='uni-card-header'>
</div>
<div class='uni-card-body'>
<div class='uni-row-on'>
</div>
<div class='uni-row-off'>
</div>
<div class='uni-row-on card-vat-fee'>
<div class='vat-fee-text'>
Credit card fees and VAT apply. See below for details.
</div>
</div>
</div>
</div>
<style>
.pricing__tier {
padding: 0;
text-align: center;
display: flex;
flex-direction: column;
width: 0%;
flex: 1;
}
.uni-card-body {
display: flex;
flex-direction: column;
}
</style>
Please Suggest.
Thanks in advance