Responsive CSS Mobile First Profile Card Component
Design comparison
Solution retrospective
- I found this more difficult than I had imagined.
- I was aiming for a pixel perfect solution.
I would appreciate if anybody would review my code and identify anything I could improve to target pixel perfection. I am using Flexbox as at this time it is my preference and I want to get better with it.
Any other advice would be greatly appreciated.
Community feedback
- @vanzasetiaPosted over 2 years ago
Hi, Chris! 👋
I wouldn't recommend aiming for "pixel-perfect" solution instead I highly recommend focusing on the quality of your code. Josh Comeau has a great article about "Chasing the Pixel-Perfect Dream" which I highly suggest reading it.
It looks like you are trying to use the BEM naming convention. If so then, there's shouldn't be any element nested within another element.
- BEM - block__element--modifier
- BEE - block__element__element
For the
card__footer
element, I would recommend usingul
and wrapping each element withli
instead. Also, instead of usingbr
element to make the text move to another line, I would recommend making thespan
asdisplay: block
instead.That's it! I hope this information is useful!
Marked as helpful0 - @ChrisMulvanyGHPosted over 2 years ago
Hi, Vanza
Made the suggested changes and a few small edits. Thanks for the help! much appreciated.
Chris
0 - @ChrisMulvanyGHPosted over 2 years ago
Hi, Vanza
Thank you very much for your feedback.
Great article and provides practical reasons for the differences in design tools and our code. Especially liked the tip on "Going the extra mile" and its information on "optical alignment".
Yes, BEM trying to get my head around how to use this properly. Need a little more practice, if you have an articles or resources on this I would appreciate them.
I was toying with the idea of using
ul
andli
for thecard__footer
. I totally agree and will ammend the code as suggested.Thanks again for your time, much appreciated!!
Chris Mulvany
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