Design comparison
Solution retrospective
This is my second solution. I really struggled with structuring the container that included the music note icon, text & price and change button. I had to cheat a little by following along with a youtube tutorial that I have detailed in the read me file.
I am still struggling with positioning the card in the centre of the screen. Grateful if anyone can tell me where i've gone wrong.
I also really struggled with importing the desktop back ground, as you can see from my solution it is barely wider than the order summary card. Grateful if anyone has any tips on this.
I have not yet used a media query so not sure if this will work properly on a mobile screen.
Community feedback
- @correlucasPosted over 2 years ago
Hello Shamir,
Congratulations for your solution!
Answering your question:
Basically what isn't allowing your container to align center is the property
height
inside the div called.bg__image
. So just delete this property from.bg__image
class and the card will be aligned center. Consider that for the card you don't need to set a value for theheight
since the card height will come from the padding and margin you'll add to the this container element.Note that you did a good work building this component, but there are some elements inserted in the wrong places and some stuff to fix in order to improve the responsivity.
Here's what you can do to fix some issues and improve it a bit:
1.The pattern background is inserted in the card inside the div called
.bg__image
you should add thebackground-image
with the pattern inside the body, see the code below:body { font-family: "Red Hat Display", sans-serif; background-color: var(--pale-blue); text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; background-image: url(images/pattern-background-desktop.svg); background-position: top; background-repeat: no-repeat; }
2.Card reponsivity, your card isn't flexible because you've set a fixed value for the width so the card is a block, instead of
width
usemax-width
to allow the card to contract in smaller screens.3.The card shadow is too strong, try a box-shadow with more blur and less opacity, for example:
box-shadow: 0px 0px 15px 0px rgb(0 0 0 / 30%);
I did all this changes in your code using devtools and now is working, try that and say me if fixes your solution.
Hope it works for you and feel free to write me again if you need to. Happy coding.
0
Please log in to post a comment
Log in with GitHubJoin 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