Design comparison
Solution retrospective
Had a bit of trouble with the responsiveness of this one, as well as the box shadows.
Any criticism/feedback is appreciated.
Community feedback
- @allmtzPosted almost 2 years ago
Nice job and congratulations on completing the challenge !
It looks like theres no width set on your grid element
<main>
. Because of this<main>
shrinks smaller than the content it's holding. To fix this you need to add 3 style properties to<main>
width: 350px;
: this will stop the shrinkingmargin: auto;
: this keeps the element centeredpadding: 1rem;
: this keeps the card from touching the window borders on small screens
Hope this helps !
1@MusicalaudioPosted almost 2 years agoHi @ramenDiet,
Thanks for pointing out the issue caused main shrinking smaller than it's content, I'll look into that.
As for centering the card, I'm not sure if margin: auto, or centering with grid and place-content: center is a better practice. I tend to use place-content: center as I feel like it's more explicit in what it wants to do (despite it being 2 lines instead of one), but I'm open to using margin: auto if it turns out to be a better practice.
For point 3, I believe I used margins on main of 1.5 to stop the card from touching the window border on small screens.
0 - @VCaramesPosted almost 2 years ago
Hey there! 👋 Here are some suggestions to help improve your code:
Regarding
box-shadows
, you can always use a generator;- Along with the blank
alt tag
, you also want to include thearia-hidden=“true”
⚠️ to the “illustration” and “music icon” to fully remove them from assistive technology.
More Info:📚
[MDN Aria-Hidden] (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden#description) If you have any questions or need further clarification, feel free to reach out to me.
- The “Cancel Order” was created with the incorrect element ❌. When the user clicks on the button they should directed to a different part of you site. The
anchor tag
will achieve this.
More Info:📚
- For improved accessibility 📈 for your content, it is best practice to use
em
formedia-queries
. Using this unit gives users the ability to scale elements up and down, relative to a set value.
Happy Coding! 🎆🎊🪅
1@MusicalaudioPosted almost 2 years agoHey @vcarames, thanks for the feedback.
I'll implement the aria-hidden change and anchor tag change.
I'll also look into the em best practice for media-queries and read around about it.
Thanks again, if I have any further questions I'll get back to you.
0 - Along with the blank
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