Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

order summary

Maleyka 150

@maleyka13

Desktop design screenshot for the Order summary component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


order summary

Community feedback

P

@Islandstone89

Posted

HTML:

  • Every webpage needs a <main> that wraps all of the content, except for <header> and footer>. This is vital for accessibility, as it helps screen readers identify the "main" section of a page. Change .content to a <main>.

  • Always include the alt attribute on images. Since the image and icon are both decorative, both need empty alt text:alt="".

  • Headings should always be in order, so you cannot go from a <h2> to a <h5>. Change it to a <h3>.

CSS:

  • It's good practice to include a CSS Reset at the top.

  • Remove width: 100% on .content - it is a block element, which means it takes up the full with by default.

  • max-width on the card must be in rem.

  • Remove the margin on the card.

  • To center the card horizontally and vertically, use Flexbox on the body:

display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100svh;
  • font-size must never be in px. This is bad for accessibility, as it prevents the font size from scaling with the user's default setting in the browser. Use rem instead.

  • On the image, remove width and change max-width to 100%. Also, add display: block.

  • Media queries should be in rem, and you usually do mobile styles as the default.

0
Alok Suman 2,380

@Alokray007

Posted

Hello there 👋

Good job on completing the challenge !

Your project looks really good!

I have a suggestion about your code that might interest you.

There is an very useful browser extension called Perfect Pixel that allow you compare with the design image and thus see the exact dimensions. I recommend it to you.

📌 Tags like <div> and <span> are typical examples of non-semantic HTML elements. They serve only as content holders but give no indication as to what type of content they contain or what role that content plays on the page. This tag change does not impact your project visually and makes your HTML code more semantic, improving SEO optimization as well as the accessibility of your project.

I hope this suggestion is useful for future projects.

Other than that, great job!

Happy coding.

0

Please log in to post a comment

Log in with GitHub
Discord logo

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