Design comparison
Solution retrospective
How can i improve my css ?.
Community feedback
- @pikapikamartPosted over 3 years ago
Hey, good work on this one. Layout for both desktop and mobile is good.
A couple of suggestions would be:
-
Removing that
width: 100vw
on thebody
tag wo that it will remove that horizontal bar at the bottom. -
It will be better if you don't use
height: 100vh
on thebody
tag, it might look good when not inspected, but if you start inspecting it, dev tools at bottom, you could see that your content is being pushed to the top or bottom, sinceheight: 100vh
only gives an element 100% of the remaining screen's height. Usingmin-height: 100vh
will be much better, then just add padding to the top and bottom of thebody
tag, to prevent element touching ceiling and flooring. -
Too many h1 being used. It will be really good if you somehow changed those to other header tags. Keeping only 1 h1 per page will be a good practice.
-
Adding a
cursor: pointer
to the button will be good, making it more feel natural since it is interactive element. -
Reaching mobile state, remove the
width: 100vh
to remove horizontal swipe.
5.1. Removing the
height: 100v
again on thebody
tag to allow the content give dimension to thebody
. Then give padding to the top and bottom of it.Overall, good work^^
1 -
- @pawel975Posted over 3 years ago
Hi!
When doing media queries, I suggest you to write only those properties which you actually changing. Code is much shorter and properties not included in media queries are the same as they were declared at first.
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