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

responsive order summary design using Html, Css

Mohamad Mourad•190
@Mouradis
A solution to the Order summary component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


any advise for a better code ?

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Hassia Issah•50,410
    @Hassiai
    Posted over 2 years ago

    Replace <div class="container"> with the main tag, <div class="title"> with <h1> and <div class="description"> with <p> to fix the accessibility issues. click here for more on web-accessibility and semantic html

    Use the colors that were given in the styleguide.md found in the zip folder you downloaded.

    To center .box on the page using flexbox or grid, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.

    To center .container on the page using flexbox:
    body{
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    }
    
    To center .container on the page using grid:
    body{
    min-height: 100vh;
    display: grid;
    place-items: center;
    }
    

    There is no need to five . box a box-shadow.

    Increase the max-width of .box for it to be equivalent to the width of the design. max-width: 400px.

    You forgot to give the body a background-image with a background-size of contain and a background-repeat of no-repeat.

    This challenge requires a media query, in the media query change the background-image of the body.

    Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here

    Hope am helpful.

    Well done for completing this challenge. HAPPY CODING

  • Santiago Moraga Caldera•710
    @Remy349
    Posted over 2 years ago

    Hi @Mouradis, I like the final result of your project, it is very well done, just some tips for you to take into consideration for future projects:

    1.If you want to center an element you can do it very easily using Flex, what you did is fine, in the end we are different and we have different thoughts and ideas, but I want to show you this way to do it if you didn't know it yet:

    body {
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    

    With these simple lines you can center an HTML element, I applied it in the body as it is very practical and there is only one HTML element that you want to center, but in general it will depend on what you want to center and also the amount of elements to center.

    2.Note that you did not put the background image that the project should have, in order to do this there are different ways to do it, I will show you one that will be related to the portion of code that I left you in the first tip:

    body {
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
    }
    
    body::before {
      content: '';
      position: absolute;
      background-image: url(Your image here!);
      width: 100%;
      // This value may vary, it will depend on you
      height: 100%;
      // You can use this for the image position,
      // these values will depend on you
      top: 0;
      left: 0;
      // This is another way, these values will depend on you
      background-position: top 0 left 0;
      z-index: -10;
      // From time to time you will find it necessary to use the following values,
      // so that the image is not distorted
      background-size: Here you can use cover or contain, there are more;
      background-repeat: Here you can use no-repeat, there are more;
    }
    

    This should be enough to add the background image, but as I said, there are many ways to achieve the same result, this is one.

    I recommend you to investigate more about these concepts, specially the pseudoelements (::before, ::after, .....), also try to find other ways to do the same, it will help you to improve a lot and to know different ways to solve these problems.

    I hope my advice will be helpful for your future projects, keep on learning web development :)

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, SASS, 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