Design comparison
SolutionDesign
Solution retrospective
What is the best way to write a mobile layout?
Community feedback
- @pikapikamartPosted about 3 years ago
Hey, great work on this one. Layout in general looks fine, just that the mobile layout, the layout is bit pushed on the top.
Are you referring to mobile first approach? Or just like writing codes for mobile layout? I mean there is no best way to create a layout right, it depends for every developer since they may used different stylings to create the layout.
Some other suggestions would be:
- You don't need
font-size: 16px
on thebody
tag, since by default it uses 16px or 1rem. - Always have a
main
element on your page. This should wrap the main content of your page, this helps users to properly navigate your site. On this one, the.backGround
selector should usemain
instead ofdiv
. - Avoid using
height: 100vh
on a large container, this makes the element's height limited to the remaining viewport/screen's height. On your.backGround
selector, instead of that, replace it withmin-height: 100vh
as well. alt
value for the vector image should bealt=""
and add an extraaria-hidden="true"
attribute on theimg
. If an image is just decoration, especially if the image is just vector image, always hide it using the mentioned method. If the image is meaningful, then use meaningfulalt
value.- Also, when using
alt
avoid using words that relates to "graphic" such as "illustration, image, icon.."img
is already an image, so no need to describe it as one. - Always have an
h1
element on a page. For this one, since you useh2
on theorder summary
you could make theh1
a screen-reader only text, meaning it will usesr-only
class. Look up on the net on how it is used. - The music-icon should be hidden as well, using the above method.
annual plan
should beh3
noth4
. Do not skip a level, if you useh4
make sure thath1, h2, h3
are present before it.- Lastly, maybe lowering down the height of the overall layout.
Aside from those, great work again on this one.
Marked as helpful0@RuKatyaPosted about 3 years ago@pikamart Thank you for you feedback! I am learning how to make the optimal layout for mobile.
0 - You don't need
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