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

Responsive Order Summary Card using Flexbox, Google Fonts, and Media Q

@safyabdelrahem

Desktop design screenshot for the Order summary component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Tharun Raj 1,290

@Code-Beaker

Posted

Hi there, congratulations on completing the challenge. You've done a good job with this one... 🥳

I have taken a look at your live preview and source code. Let me share some of my suggestions to help you improve your current solution.

  • Use class for styling components rather than the element/tag selector. When working on big projects, classes can be a lifesaver. Using tags can make it complex and confusing as it applies to all instances of the specified tag.
  • The "Change" link should not be wrapped inside p tag. It is a link and should only be wrapped in an a tag.
  • You can have the buttons use the same font as the rest of the body by using an inherit in the CSS:
body {
font-family: "Red Hat Display", sans-serif;
}

button {
font-family: inherit;
}
  • There's an easier way to center something vertically and horizontally on a page by using display: flex:
.container {
display: flex;
justify-content: center;
align-items: center;
}

But, you need to move the card's elements into a new container.

<div class="container">
<div class="card">
... EVERYTHING INSIDE THE CARD GOES HERE ...
</div>
</div>
  • Import Google Fonts inside the HTML. This is better for the website's performance.
  • Use CSS Variables/Custom Properties to improve reusability across your CSS. Here's how you can create variables:
:root {
--font-main: "Roboto", sans-serif;

--weight-light: 300;
--weight-regular: 400;
--weight-bold: 700;

--color-white: #fff;
--color-black: #000;
}

Learn more about variables here

  • Never* use pixels to set your font size. Here's why

Hope you find these helpful in improving your solution, Happy coding! 😄

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