Order Summary Challenge with Responsive Grid and Flexbox
Design comparison
Solution retrospective
Hi all! This is my first solution on frontendmentor. I suspect strange behaviour that the preview between firefox and chrome are different. I don't have any idea what happened, i don't know it's because my firefox or my code but they are gives the same result, only different scale. Also any feedback is appreciated!
Community feedback
- @vanzasetiaPosted over 3 years ago
👋Hi Ahmad Syafiq Aqil Wafi!
I have some feedback on this solution:
- On mobile view (360px * 640px), the music icon is so big. Try to keep the original size (from the svg file).
- For any decorative images, you should leave the
alt=""
empty and addaria-hidden="true"
orrole="presentation"
. It will make sure all screen reader ignore those images. In this case, all images are decorative only. - It seems like you are using BEM class naming convention or method. You can't nest an element inside an element. I recommend to read this BEM by example article
<div class="modal-box__plan-item__details"> <h2 class="modal-box__plan-item__details__item">Annual Plan</h2> <p class="modal-box__plan-item__details__item">$59.99/year</p> </div>
- This one is also should be a modifier.
<button class="btn btn-primary"> Proceed to Payment </button>
- You should not limit the
height
of thebody
element. You should usemin-height
instead. Right now, thecard
gets cut off on mobile view (360px * 640px). - To make the
modal-box
perfectly center on the page, I recommend to use this methods. It's much easier than using absolute positioning.
body { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
- You should wrap all your page content with landmark, like
main
andfooter
tag. Wrap all your page content, except the attribution withmain
tag. For theattribution
, you can swap thediv
withfooter
tag. Annual Plan
should not be a heading. Heading tags only for titling a section. I recommend to usestrong
tag instead.- Never use
px
. Userem
or sometimesem
instead.
Tips for writing a better HTML:
- Plan your HTML markup first, without taking care about the styling.
- Decide the HTML markup, like you're writing a document.
That's it! Hopefully this is helpful!
Marked as helpful1@SyafiqjosPosted over 3 years ago@vanzasetia
Wow, thank you for your detailed feedback Vanza Setia! I learnt more than I can imagine!
I just knew about
role
attribute, I will read more about it.That's right, I try to use BEM naming convention. Thank you for providing BEM resources! The examples are clearing my confusion.
That tips for centering modal-box is really useful! Although the centering div meme is really popular haha. I rarely use
min-
ormax-
styling. I think I should try to use them from now on.That's
never use px units
tips is probably the reason why my work looks different on firefox and chrome. The pixel / screen on each browser probably different. I'll use rem or em from now on and will use px units when I have a reason to do so.Also thank you for the last second tips. You are right, I was actually switch between html and css file and do it simultaneously. Planning is really important.
I would like to say thank you again for this helpfull feedback! I wish other person who has the same problem as mine could read your feedback, so they will got better next time.
1@vanzasetiaPosted over 3 years ago@Syafiqjos 🤗 You're welcome! I am glad that it's really helpful for you!
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