Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Single price grid commponents (html and css)

rajendra2708578•90
@rajendra2708578
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 not responsive. Used HTML and CSS. Any kind of suggestions are welcomed.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Melvin Aguilar 🧑🏻‍💻•61,020
    @MelvinAguilar
    Posted over 1 year ago

    Hello there 👋. Good job on completing the challenge !

    I have other suggestions about your code that might interest you.

    • Wrap the page's whole main content in the <main> tag.
    • For specificity reasons you should work with classes instead of ids because they are more reusable. You can use ids to work with JavaScript, but you should use classes to style your elements. You can read more about this here 📘.
    • The <br> tag is often used to create line breaks, but it doesn't convey any semantic meaning. Use <ul> and <li> for the content under "Why Us": Since the content is a list of items, it's more semantically correct to use an unordered list (<ul>) and list items (<li>) instead of using paragraph (<p>).

    I hope you find it useful! 😄 Above all, the solution you submitted is great!

    Happy coding!

    Marked as helpful
  • Josh Michael•1,070
    @joshmichael23
    Posted over 1 year ago

    Great job on your project. You can make it better by using the font given in the style-guide.md.

    What I usually do is go to fonts.google.com then search for the font. Add the necessary font-weights by clicking on the + and then click the cart on the top right. You can then use the <link> or the @import under the Use on the web section depending on your preference. Hope it helps :)

    Marked as helpful
  • P
    Daniel 🛸•44,810
    @danielmrz-dev
    Posted over 1 year ago

    Hello @rajendra2708578!

    Your project looks great!

    I noticed that you used position to place the card in the middle of the page. Here's two very efficient ways to center the card:

    • You can apply this to the body (in order to work properly, you can't use position or margins):
    body {
        min-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    • Or you can apply this to the element you wanna center (works well with projects with only one centered element, like this one):
    .element {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    

    Other details to improve your project and make it look even closer to the original design:

    • Check the style-guide file to check what's the recommended font-family for the project.
    • Add a border-radius to the div#card. Something like border-radius: 6px; overflow: hidden; is enough;
    • Instead of using div for the main content, use main. It won't change anything visually but it makes your HTML code more semantic and improves SEO optimization and acessibility.

    I hope it helps!

    Other than those details, your solution is great!

    Happy New Year 😊

    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

Oops! 😬

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

Log in with GitHub