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

Desktop Order Summary using HTML and CSS

@YaswanthVarma362

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 positioned the entire box in center by calculating pixels and adjusting by changing every time, please help me on how to do it. I tried placing "Change" button in right center of the "Annual Plan" and "$59.99/year" but "Change" is coming either in any line but not in middle, help me in how to do it. I am new so don't know much about shadow a little help for proceed to payment shadow will be helpful. Thank you.

Community feedback

P
Katrien S• 1,070

@graficdoctor

Posted

Hi. By looking at your question and code I can tell you don't know flexbox yet. Every question you have about positioning would be solved by just using flexbox. [More on centering divs] (https://levelup.gitconnected.com/5-ways-to-center-a-div-using-css-fcd790524708) I will make a few suggestions for the rest of your code.

  • The background-image needs to be set on the body and span the entire width of the body. By setting it on .background-image you limit the size of your webpage as this acts as some sort of container. It's possible you could actually even delete this <div> and set the background-image on your body.
body {
  margin: 0;
  background-color: hsl(225, 100%, 98%);
  text-align: center;
  font-family: "Red Hat Display", sans-serif;
  font-weight: 500;
  color: hsl(224, 23%, 55%);
  background-image: url(../images/pattern-background-desktop.svg);
}
  • The buttons hold a lot of repetitive code. If this happens, you can actually use classes to bundle the repetition and end up writing less. Give both 'buttons' the same class .btn and give 'cancel' a second class .btn-cancel. Also give the buttons a display: block when they need to span all across the box. See also how I added auto to the margin to help center the buttons.
<a class="btn" href="">Proceed to Payment</a>
<a class="btn btn-cancel" href="#">Cancel Order</a>

In css this would eventually give you this:

.btn {
  background-color: hsl(245, 75%, 52%);
  width: 75%;
  color: white;
  border-radius: 8px;
  display: block;
  margin: 10px auto;
  padding: 13px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  background-color: hsl(225, 100%, 94%);
  color: hsl(223, 47%, 23%);
}
.btn-cancel {
  color: hsl(224, 23%, 55%);
  background-color: hsl(225, 100%, 100%);
}
.btn-cancel:hover {
  background-color: hsl(225, 100%, 94%);
}

Have a look at this and see how far it will get you. Happy coding!

Marked as helpful

0

@YaswanthVarma362

Posted

@graficdoctor Thank you for your suggestions and feedback, Those are effective. But when I use background-image in body, the same image repeated 3 times to cover the entire body.

I later saw your code and used background-repeat: no repeat. The problem was fixed. Thanks again.

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