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

Order summary component

Jordan•180
@GitNutts
A solution to the Order summary component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hi!

Just completed this project. I'm happy with the end product but would appreciate any feedback for anything you feel could be done better.

I've added a media query for mobile and it looks fine in dev tools but I'm not sure if my method is the most efficient way of approaching this?

Thanks

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. Layout in general looks great.

    Others already gave their feedback on this one, just going to add some suggestions as well:

    • Right now, if you hover on the html tag or body, you will notice that it has no height since the main component is using position: fixed which takes an element out of the flow. Avoid using this or position: absolute . Since you are using this to only center the content, it will be better to do it this way, but first, remove all these properties on the .card selector:
    left
    top
    position
    transform
    

    and on the body tag add these:

    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh; # so that flexbox will have enough height to center vertically
    

    This is more consistent as this will always center the content and you avoided using position property on the layout.

    • Vector image should be hidden since it is only decoration. Decorative image must be hidden at all times for screen-reader users by using alt="" and extra aria-hidden="true" attribute on the img tag.
    • Also when using alt attribute, avoid using words that relates to "graphic" such as "background" and others. An img is already an image/graphic so no need to describe it as one.
    • A page must have a single h1 on a page. Since there are no text-content that are visible that could be h1, you will make the h1 screen-reader only text. Meaning this will be hidden for sighted users and only be visible for screen-reader users, search about sr-only stylings and see how it is used. The h1 text should describe what is the main content is all about, this h1 would be placed as the first text-content inside the main element.Have a look at this simple snippet of mine implementing the sr-only heading tag. I already added some comments in the markup so that it will be easy to understand^^.
    • Music-icon should be hidden as well using the method I mentioned.
    • When wrapping a text-content do not just use span to wrap it, use meaningful element like a p tag if it just a regular text or heading tag if it is an heading.
    • annual-plan could use a heading tag since it gives information on what the section would/could contain, hence the pricing for such plan the user has chosen.

    Aside from those, great job again on this one. If you have any queries just let me know.

    Marked as helpful
  • Ken•4,915
    @kens-visuals
    Posted over 3 years ago

    Hey @GitNutts 👋🏻

    I have some suggestions to help you fix the accessibility issues and some other things.

    • In HTML, <div class="card">...</div> should be <main class="card">...</main>. This will fix the accessibility issues, just, don't forget to generate a new repot once you fix the issues.
    • For the music icon, add aria-hidden="true”, because it's for decoration. You can read more about aria-hidden here.
    • Also, I suggest adding transition: all 0.2s; to the button and the links, this will make :hover smoother

    I hope this was helpful 👨🏻‍💻 and to answer your question, yes, your approach is good enough, but I'd suggest learning mobile first approach of building websites. That's more efficient and, a lot easier than, the traditional approach (desktop first). Other than that, you did a great job for the first project, keep it up. Cheers 👾

    Marked as helpful
  • Dusvy_M•520
    @dovelm
    Posted over 3 years ago

    Excellent!!, very good in mobile

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