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 Component (Vanillia CSS)

P
Michael 380

@Mlchaell

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 only have one question - How would I do the .extra-card-section without using the media queries? If I do it without the queries, the a tag gets pushed out of the section on the right

Also, if anyone else ideas/feedback on how I could do anything else better, let me know!

Community feedback

Adriano 34,090

@AdrianoEscarabote

Posted

Hi James, how are you?

I really liked the result of your project, but I have some tips that I think you will enjoy:

To make your challenge more similar to the example layout, we can do this:

body {
    background: url(image) #E1E9FF;
    background-repeat: repeat-x;
}

The rest is great!

I hope it helps... 👍

Marked as helpful

1
SD_Voyez 110

@SD-Voyez

Posted

Hi !

First off all, good job :)

For me the mistake is to use margin-left with your tag <a>, it brokes everything when you reduce screen.

You should trie to :

  • Remove your margin-left in your tag <a>
  • Put a justify-content : space-arround in your class .extra-card-section

I tried with your code and it's much better.

Sorry for my "french" english, hope you understand me :)

Regards.

Marked as helpful

1

@JAleXDesigN

Posted

Hi Michael, good job!!.. Here are some recommendations: In the .card class, in addition to the "max-width: 25em" you must put a "width: 90%" it can be another percentage depending on the width you want the card to occupy when the screen is not 25em wide.

If you leave it only with the maximum width, the card will always have that width and will not adapt to mobile devices. The code would look like this and the margin would not be necessary:

  .card {
      max-width: 25em;
      width: 90%;
      margin: 2em 2em 2em 2em; //You can delete this line.
  }

Here is a link on how to shorthand certain css properties CSS - shorthand properties

Regarding your question about how to put the link on the right, you can wrap the .stack-items container and the "change" link in a "div" like so:

      <div class="extra-card-info">
          <div class="stack-items">
              <p class="bold-dark-blue">Annual Plan</p>
              <p class="desaturated-blue-text">$59.99/year</p>
          </div>
          <a href="#">Change</a>
      </div>

And the css:

    .extra-card-info {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

And you could already delete the media queries and the "margin-left: 7em;" from class .card-extra-section a {}.

Marked as helpful

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