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

LyttleGC 30

@LyttleGC

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


This was a fun project to work on positioning for me. It was a struggle, but I enjoyed being able to figure it out!

Centering the container keeps seeming to be a bit of a time killer for me, but practice makes perfect.

One question I have is that in the design previews the SVG background file shows two different shades of blue but mine was blue and white. Is there a way to change the colors in these files? I was able to change one, but couldn't change the bottom.

Community feedback

M 940

@Dev-MV6

Posted

.card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

and also remove the margin-top: 100px; you have set in the .card styles. This way the card would be centered correctly.

  • Regarding to the color issue, simply use the following styles to get the same colors as the original design:
body {
  background: hsl(225, 100%, 94%) url('./images/pattern-background-desktop.svg');
  background-size: cover;
  background-repeat: no-repeat;
}

.card {
  background-color: #fff;
}

.card__plan {
  background-color: hsl(225, 100%, 98%);
}

button {
  background-color: hsl(245, 75%, 52%);
}

.card > a {
  color: hsl(224, 23%, 55%);
}

Hope you find this helpful.

Marked as helpful

1

LyttleGC 30

@LyttleGC

Posted

@Dev-MV6 Thank you! This helped a lot!

0

@JosephAbuchi

Posted

The easiest way to center your element: display: grid; justify-content: center; align-items: center;

1

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