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 Card usig HTML and CSS

@nikolapetkovicdev

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


Another task successfully completed in the series. I hope I haven't made any mistakes. If I have, please let me know. Additionally, if there's anything I could have done better, feel free to provide feedback; it would mean a lot to me. Thank you, and happy coding!

Community feedback

P

@Islandstone89

Posted

Hi Nikola. I like that you include the <main> landmark, and use rem instead of px for font-size - well done!

Here are some suggestions I hope you find helpful.

HTML:

  • The image and the icon are decorative, hence their alt text should be empty:alt="".

  • Headings should always be in order, so you can never jump from a <h1> to a <h4>.

  • "Cancel Order" would likely trigger an action, so I would change it to a <button>.

CSS:

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

  • Add around 1rem of padding on the body, so the card doesn't touch the edges on small screens.

  • Paragraphs have font-size: 1rem as their default, so you don't need to declare it explicitly.

  • Remove all widths.

  • Add a max-width in rem on the card, so it doesn't stretch too wide on big screens.

  • Remove position: absolute, it is not needed.

  • On the image, add display: block and max-width: 100% - the max-width prevents it from overflowing its container.

  • Don't use % on margins.

  • Media queries must be in rem, and it is common to do the mobile styling as the default.

Marked as helpful

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