NFT Card Component with flex and ::before/::after overlay
Design comparison
Solution retrospective
For the clock icon before 3 days left, I can't figure out how to align it vertically with the "3 days left" text.
Community feedback
- @ianbuenPosted over 1 year ago
I think for the .time class, you could either try to add display: 'flex' and align-items: 'center', or adjust a bit of top padding or margin for .time::before. I'd test it myself first, but I'm yet to be back at home on my PC.
Marked as helpful0 - @ryanthayesPosted over 1 year ago
That gave me an idea to try. I had been trying to change the main element NOT the pseudo element. I was able to fix by adding vertical-align to the pseudo element:
.time::before { content: url(images/icon-clock.svg); padding-right: .5em; vertical-align: middle; }
1
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