Design comparison
Solution retrospective
It was an easy challenge
Community feedback
- @denieldenPosted almost 2 years ago
Hello Ismail, You have done a good work! 😁
Some little tips to improve your code:
- use
main
tag to wrap the card and improve the Accessibility but not as a container of that one element - centering a
div
withabsolute
positioning is now deprecated, it uses modern css likeflexbox or grid
- use flexbox to the body to center the card. Read here -> best flex guide
- after, add
min-height: 100vh
to body because Flexbox aligns child items to the size of the parent container - instead of using
px or %
use relative units of measurement likerem
-> read here
Keep learning how to code with your amazing solutions to challenges.
Hope this help 😉 and Happy coding!
0 - use
- @Dana-HongPosted almost 2 years ago
Hey Ismail,
Good effort with this challenge. I noticed that your QR image is not centered and that you were using
position
to center elements. Here are some tips to consider:It's much easier to center elements by either using
flexbox
, ormargin: 0 auto
if the child element has a set width.
For example, your .main__card__thumbnail has a set width of
250px
. You can simply remove position-related properties likeposition: relative
andleft: 3%
, set the margin tomargin: 0 auto
, and give itdisplay: block
. This will save you time, as you don't have to tinker around with percentages trying to get it perfectly centered.You can also look into short-hand properties; for example, you can write
border-radius: 10px
instead ofborder-radius: 10px 10px 10px 10px
to save you time.Hope this helps!
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