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

order-summary-component-main

Khalid Rabiu Salis•120
@Khalid-R-Salis
A solution to the Order summary component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


corrections are suggestions are well welcome... thank you for your time

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Raphael Holzer•850
    @DigitaleWeltLibrary
    Posted over 1 year ago

    Hey, there is a small error in your CSS:

    Instead of height:100%; write height: fit-content; or delete the line.

    Happy coding

  • Kirsten ✨•460
    @ofthewildfire
    Posted over 1 year ago

    Hi! Good solution, I just have a few things I think could be helpful

    • While you do import your google font, you actually haven't used it anywhere, you'll need to use it as a font-family: "font-name"; with the elements you need to apply that font to. Eg. font-family: 'Red Hat Display'; would be one of them, when you copy-paste the link, it also provides the names of the fonts on the Google interface in the sidebar! :)

    • Within your .container class, there is no real need for the margin-top/margin-bottom, in my experience using margins is kinda a way to confuse a situation. To center the card, you can use flexbox on the body, eliminating the need for the margin hack. <3

    body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    }
    
    • Within your .container class, you're using fixed width and this makes it not a good viewing experience on mobile/smaller screen, currently your container is set to 450px, so, if I shift to mobile it has over-scroll, in general fixed-width items is no bueno :) - a fix for this would be to use a max width for now and maybe do further research on width in CSS for responsiveness. This will help it flow better though> max-width: 400px and also, removing the height on your .container would go a long way. Height is not needed. :)

    • Removing the width on your container, will mean that your image will be out of the container, images should be able to resize with their content, so, to fix this, adding a width to the image would be very beneficial max-width: 100%;

    • Finally, not really needed, but, I think it looks better, adding a flex-wrap: wrap on your .two class div so that when the screen is smaller it wraps to the next line and looks neater might be helpful.

    PS: If you want to not make it flush against the edges, and add some space. Which I guess some people like, adding a margin: 0 1em; to the container would do that! :)

    Overall, a great solution and I hope this was helpful~

    Happy coding! :)

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 1st-party linked stylesheets, and styles within <style> tags.

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.

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