Design comparison
Solution retrospective
How is the best way to position element on this box? First, I try to use flexbox, but I managed this problem with grid. Is it right?
Community feedback
- @PhoenixDev22Posted over 2 years ago
Greeting @abuk111,
I have few suggestions regarding your solution:
-
There should be two landmark components as children of the body element - a
main
(which will be the component ) and afooter
(which will be the attribution).<Footer>
should not be in the<main >
. HTML5 landmark elements are used to improve navigation . -
Page should contain a level-one heading . As this is not a real webpage , you can use
<h1>
withclass="sr-only"
(Hidden visually, but present for assistive tech). -
The alternative text is needed on that image for assistive tech and SEO search engine optimization . So it needs to contain a description like Qr code for frontend mentor .
-
Using
min-height: 100vh
instead ofheight: 100vh;
allows the body to to grow taller if the content outgrows the visible page. -
height: 500px; , or height: 180px;
It's rarely ever a good practice to set heights on elements, you almost never want to set it . let the content define the height . -
width: 320px;
an explicit width is not a good way . consider usingmax-width
to card instead and a little margin to the card . -
You should use
em
andrem
units .Bothem
andrem
are flexible, Usingpx
won't allow the user to control the font size based on their needs. -
It's recommended not to use
px
for font-size. you can use rem instead .
Overall , your solution is good .Hopefully this feedback helps.
Marked as helpful1@shashreesamuelPosted over 2 years ago@PhoenixDev22 I agree with your suggestions however I think that for the last point it needs to be mentioned additionally that rem means responsive em hence if a user has certain preferences in terms of the font size then rem just better adapts to that preference.
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