NFT Product Card with CSS Flexbox

Solution retrospective
Could anyone help me with aligning the svgs to the the center in relation to the text to the right of them? As always if you see other areas of improvement feedback is welcome!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @gwtpraveen
congratulation on completing the challenge. to align the svg with the text, use display flex and align items center.
.flex-item { display: flex; align-items: center; } .cyan { margin-left: 8px; }
try not to use height instead use min-height
body { min-height: 100vh; }
Marked as helpful - @Jorgus1710
Apply the following code to your "flex-item" div into CSS and it should do the trick:
display: flex; align-items: center;
By setting display to flex, it sets the items to row by default, and then the "align-items: center" is what's going to line those items up the way you want them to.
Marked as helpful - @mycrochip
Hello Kylee,
Well done on completing the challenge.
I have completed the challenge as well. My hack was to use a pseudo-class. I chose to see them as bullets and placed the icons (.bullet) relative to their texts the following way:
.bullet1::before { content: url("images/icon-ethereum.svg"); position: relative; left: -5px; top: 3px; }
.bullet2::before { content: url("images/icon-clock.svg"); position: relative; left: -5px; top: 3px; }
You can see my solution here: https://github.com/mycrochip/nft-preview-card.git
Marked as helpful - @samuelpletain
Congrats on finishing this challenge Kylee! Your code looks clean and your solution looks great on both mobile and desktop views. Just a personal preference: I would add a margin-top when viewing on desktop to push your card off the top a bit. You can use the vertical-align property to adjust the vertical alignment of your svgs. https://developer.mozilla.org/fr/docs/Web/CSS/vertical-align
Marked as helpful
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