Design comparison
Solution retrospective
I'm struggling to give card::before
the same width as card.
Right now, I kind of made it look good but it's still unfinished How can I get it right??
Community feedback
- @DonUggioniPosted about 2 years ago
Hey there,
By the looks of it, you're setting your card to a max-width of 22rem and the before element a fixed width of 10rem.
Usually, when you want to position a before or after pseudo element, you need to make it position absolute and its parent position relative. Try to do that and then on the pseudo element, set top:0, left: 0 and width of 100%, so it takes up 100% of it's parent width and it's responsive.
Give it a try and hope it helps!
Marked as helpful0 - @Cyrus-Akwaboah-EmmanuelPosted about 2 years ago
Nice work bro.
1@mbilal-xPosted about 2 years ago@Cyrus-Akwaboah-Emmanuel
Thanks Emmanual. Also, your design is soo cool :D
0
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