Design comparison
SolutionDesign
Solution retrospective
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.
Community feedback
- @vlad-solomonPosted about 2 years ago
That's what display flex is for!
Marked as helpful1 - @CarmendelberPosted about 2 years ago
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;
andalign-items:center;
to the parent card__pricesMarked as helpful1
Please log in to post a comment
Log in with GitHubJoin our Discord community
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