Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

Responsive design , css grids

Neha Nalini Kennedy•100
@nehanalinik
A solution to the Single price grid component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

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

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Raymart Pamplona•16,040
    @pikapikamart
    Posted over 3 years ago

    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
  • Aakash Verma•9,500
    @skyv26
    Posted over 3 years ago

    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

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub