Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive design , css grids

@nehanalinik

Desktop design screenshot for the Single price grid component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

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??

Community feedback

@pikapikamart

Posted

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 the main as this makes the element's height capped based on the viewport/screen's height. Instead use min-height: 100vh so that the element will expand if it needs to.
  • Remove the .container 's height: 50vw. Also, just in general, you don't want to just use vh unit in height or font-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 use rem. Not saying that vh is bad, but using it should be properly controlled.
  • The h3 after the h1 could just be replaced by p tag since the h1 is enough for that section. But if you insist on using heading tag, go with h2. When using a heading tag, make sure you are not skipping a level. If you use h4 then make sure that h1, h2, h3 are all present.
  • Monthly Subscription should be using h2 and not h3 and the pricing should just be a p tag since the heading tag above it already gives information on that section's content.
  • Why us should be h2 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, a ul on it would be really nice and not a single p 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

0

@nehanalinik

Posted

@pikapikamart Thanks for really breaking down and explaining it.

  1. I guess height: 100vh did not help.
  2. I should checkout more about min-height
  3. Really helpful how you have given an insight on heading tags, they should be inorder else it's not necessary. Instead use p tags
  4. I did not really checked the Why us section has li tags.
1
Aakash Verma 6,690

@skyv26

Posted

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.

  1. 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

0

@nehanalinik

Posted

@skyv26 Thanks for the suggestion it helped! div container is not sticking to the bottom now.

0

Please log in to post a comment

Log in with GitHub
Discord logo

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