Design comparison
Solution retrospective
Hi
I have completed another challenge using flexbox. While building the project, I found the box shadow and styling the button difficult.
What is the best resource for learning responsive design? Any suggestions to improve this project are welcome.
Community feedback
- @andreasremdtPosted about 2 years ago
Hey @mayor-creator!
Nice job on this challenge, it looks good! Don't worry, responsive design is hard to do right in the beginning, you'll get better. If you like learning from videos, I can highly recommend Kevin Powell's YouTube channel, he explains things about web development in a great way, like this one about responsive design.
I went over your code and can give you a couple of tips:
- For the title ("Order Summary"), you used an
h2
. Since it's the only title on the page, it would be better to use anh1
. Each website should start with anh1
, since it's the most important title describing the page. If there are more headings, you can lower withh2
,h3
, and so on. - The design contains three interactive elements, and it was a good decision to use a
button
for "Proceed to Checkout". However, you didn't use interactive elements for the remaining two, which is confusing and hurts UX. Even though they are styled as links, clicking on them doesn't do anything. I recommend usinga
elements, for this challenge they don't need to point to anything. - Sticking to your interactive elements such as the button, it's a good practice to think about hover and focus styles. For example, you could make the blue darker on hover and even darker on focus, so that mouse and keyboard users know that this button is currently "selected".
- You have an
img.music_icon
element for the music icon. In this case, I would leave thealt
text empty, because it's mostly for screen reader users. They don't gain any benefit from this icon, it's purely for styling purposes and doesn't add anything to the content. So, you could writealt=""
to indicate that the image is not important, or even addaria-label="hidden"
to hide it from screen readers. - On smaller screens, the card is stuck to the bottom of the browser. Adding some margin (like you did for the top) would give it more breathing room and improve the styling.
Hope these tips help you out, let me know if you have any questions :-)
Marked as helpful2@mayor-creatorPosted about 2 years ago@andreasremdt thank you for the insightful feedback. I will definitely apply it to the next project.
0 - For the title ("Order Summary"), you used an
- @vanzasetiaPosted about 2 years ago
Hi, Paul! š
Congratulations on finishing this challenge! š
I recommend reading the "Responsive design ground rules" blog post. This will give you a guide on how to create a robust and predictable responsive design.
@andreasremdt has given incredible feedback and I recommend implementing them on this project. That feedback is specifically for this solution and also improving your code is something that you will often do as a developer.
Some suggestions:
- Use CSS to give underline instead of using
u
tag. - There's no need to set
height
on the card (main
). Let the elements inside it control the height of it. - The card only needs a
max-width
to prevent it from filling the entire page. By usingmax-width
the card allows to shrink if ever needed. So, setmax-width
and removewidth
. - To make the card in the middle of the page, you can make the
body
element a flexbox container.
/** * 1. Make the card vertically center and * allow the body element to grow if needed */ body { display: flex; align-items: center; justify-content: center; min-height: 100vh; /* 1 */ }
- Use the
em
unit for media queries. It adapts when the users change their font size setting. Here are some references. - Use
rem
or sometimesem
unit instead ofpx
. Usingpx
will not allow the users to control the size of the page based on their needs. I recommend reading this article aboutrem
andem
unit. This article explains both units in a simple way.
I hope this helps. Happy coding!
Marked as helpful1@mayor-creatorPosted about 2 years ago@vanzasetia thank you for sharing these resources and providing keen feedback.
1 - Use CSS to give underline instead of using
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