Responsive design , css grids

Solution retrospective
This is my first time submiting solution here. And I have a doubt. Can anyone tell me ..If I have centered the div then how can I get padding/margin at the bottom of the div if I have no more contents to show after that centered div??
Please log in to post a comment
Log in with GitHubCommunity feedback
- @pikapikamart
Hey, awesome work on this one. Though for desktop state, the layout is too wide and if you try to zoom out, you will see that the layout doesn't really respond well and just kind of makes the content out of place. For mobile state, it looks fine but it could use more width since it is small.
Besides Aakash Verma great feedback, here are some other suggestions:
- Don't use
width: 100vw
since this will only add a horizontal scrollbar at the bottom, since this value does not account the vertical scrollbar's width. - Avoid using
height: 100vh
on a large container like themain
as this makes the element's height capped based on the viewport/screen's height. Instead usemin-height: 100vh
so that the element will expand if it needs to. - Remove the
.container
'sheight: 50vw
. Also, just in general, you don't want to just usevh
unit inheight
orfont-size
or just in other since it is not consistent and will vary depending on the user's screen-size. It would be better to userem
. Not saying thatvh
is bad, but using it should be properly controlled. - The
h3
after theh1
could just be replaced byp
tag since theh1
is enough for that section. But if you insist on using heading tag, go withh2
. When using a heading tag, make sure you are not skipping a level. If you useh4
then make sure thath1, h2, h3
are all present. Monthly Subscription
should be usingh2
and noth3
and the pricing should just be ap
tag since the heading tag above it already gives information on that section's content.Why us
should beh2
as well.- Those information on the
Why us
section, as you can see, those are "list" of things on why the user should "choose" them. Meaning, aul
on it would be really nice and not a singlep
tag to wrap the whole text. - Lastly, just addressing the styling on the overall layout.
Aside from those, great job again on this one.
Marked as helpful - Don't use
- @skyv26
Hi! Neha, Very well done, you have completed your first challenge. I will answer all your doubt by telling you the issues with my sugges tion/solution.
- Your design a bit wider than expected. I mean you can clearly see in your design comparison. Solution
.main { width: 100vw; height: 100vh; display: grid; place-items: center; }
Change above code with below:
.main { width: max-content; height: auto; margin: 5rem auto; }
Your problem will be solve. By solving this I think all will be good. ~~!! Your answers ? what I wrote above answers your all question and try to get more details on MDN.
Best of Luck
Marked as helpful
Join 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