Vlad Solomon• 270
@vlad-solomon
Posted
That's what display flex is for!
Marked as helpful
1
I found it difficult to align the current price and old price design until I found out that it would be easy by putting the elements in a table data cell and adding display : table-cell; to the stylesheet.
@vlad-solomon
Posted
That's what display flex is for!
Marked as helpful
@Carmendelber
Posted
Hey! You can use flexbox to align both prices too:
<div class="card__prices">
<p class="price-main">$149.99</p>
<p class="price-deleted">$169.99</p>
</div>
You need to add display:flex;
and align-items:center;
to the parent card__prices
Marked as helpful
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord