Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Product Preview Card Component

Tony 50

@Snorri967

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

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-solomon

Posted

That's what display flex is for!

Marked as helpful

1

@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

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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