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 page using html and css

Deeem 40

@Deem1203

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


I had an issue not getting the container to stay in the middle, there for if you shrink the page it will not stay centered until it reaches 500px

Community feedback

Travolgi 🍕 31,420

@denielden

Posted

Hello Deeem, You have done a good work! 😁

Some little tips to improve your code:

  • add main tag and wrap the card for improve the Accessibility
  • also you can use article tag instead of a simple div to the container card for improve the Accessibility
  • you can use picture tag to change image by resolution -> read here but the best way is just put more specific background properties to the body like this:
background: url("../img/pattern-background-desktop.svg") no-repeat top center;
background-size: contain;
background-color: #e0e8ff;
  • centering a div with absolute positioning is now deprecated, it uses modern css like flexbox or grid
  • use flexbox to the body to center the card. Read here -> best flex guide
  • after, add min-height: 100vh to body because Flexbox aligns child items to the size of the parent container
  • use min-height: 100vh to body instead of height, otherwise the content is cut off when the browser height is less than the content
  • instead of using px use relative units of measurement like rem -> read here

Keep learning how to code with your amazing solutions to challenges.

Hope this help 😉 and Happy coding!

Marked as helpful

0
Hassia Issah 50,670

@Hassiai

Posted

To center the content on a page, specify the following inn the body: body {min-height:100vh; display: flex; justify-content: center; align-items: center;} or body {min-height:100vh; display: grid; place-items: center;}. No need to use position to center the content. No need for the transform as well. Use rem and as unit for the padding, margin and font-size values. preferably use rem for the font-size. by default 1rem or em= 16px. Hope am helpful HAPPY CODING

Marked as helpful

0

Deeem 40

@Deem1203

Posted

@Hassiai

I am quite new to this so I'm always getting stuff wrong haha, I found centering with the top:, left: and transform works and I got into a habit of it. I appreciate your help!

0

@tchytech

Posted

This looks good for a start. Just keep practicing. Practice makes you a master in the act. @Hassiai

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