Design comparison
Solution retrospective
This is my first project and I found it to be slightly difficult. I was unsure of the strikethrough for the old price. What is the best way to lineup text, does it matter if "Perfurme" is in <main> or <heading> tag as long as is lines up.
Community feedback
- @khaya05Posted about 2 years ago
Hey Natasha👋🏽
For
flexbox
to work, you must have a parent/container element, which in your case is<div>
with a class namecard
.Then inside your parent element, you can add all the elements that you want to display flex. For this project, you want to have a two-column layout. Therefore you must have only two child elements inside
.card
ie<div class="card"> <div class="card__left"></div> <div class="card__right"></div> </div>
Then inside your
.card__left
you can the product image and on the.card__right
add all the product info i.e<div class="card"> <div class="card__left"> <img src="" alt="" /> </div> <div class="card__right"> <h2></h2> <h1></h1> <p></p> <p class="current-price"></p> <p class="original-price"></p> <button type="button"></button> </div> </div>
Then in your
.css
.card { display: flex; justify-content: space-between; align-items: center; }
Also, check out this video by Kevin Powell. It will show you how to use flexbox and how to analyze a design.
Hope this helps✨
Marked as helpful0
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