Design comparison
Solution retrospective
I completed my second project 'Getting Started on Frontend Mentor (beginner)'. I used @media queries for this challenge due to the instructions that the page should be responsive to mobile and desktop screens. Feedback will be much appreciated.
Community feedback
- @danielmrz-devPosted 11 months ago
Hello @LuisGonzH94!
Your solution looks great!
I have a couple of suggestions:
-
Setting a fixed
width: 90%
to the card can make it overgrow depending on the size of the screen. In this case, a better option is to set amax-width
with a fixed value, for example 950px. By doing this, your card will grow until it reaches 950px and then it'll stop. As I said, this can prevent your card from turning bigger than it should. -
Also, you can add
background-color: #F2F2F2;
to the body. It'll look even closer to the original design.
I hope it helps!
Other than that, great job!
Marked as helpful0@LuisGonzH94Posted 11 months ago@danielmrz-dev I really appreciate your comments! I was recently reading something about max-width and when to apply it. I will surely consider this in my next challenge project. I will also implement your suggestions in my coding right away. I appreciate your comments.
1 -
- @MelvinAguilarPosted 11 months ago
Hello there π. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
- You don't necessarily need to add border--radius to every column Instead, you can use set to the container parent and use
overflow: hidden
on the container to clip any excess from the image, achieving a similar effect.
main { border-radius: .625rem; overflow: hidden; }
- You should use only one
<h1>
tag per page. The<h1>
tag is the most important heading tag, This can confuse screen reader users and search engines. This challenge requires thatSedans
,SUVs
andLuxury
are headings, but you can use the<h2>
tag instead of the<h1>
tag. You can read more about this here π.
- Not all images should have alt text. Car icons are for decoration purposes only, so they can be hidden from screen-readers by leaving its alt attribute empty. You can read more about this here π.
- To center the component in the page, you should use Flexbox or Grid layout. You can read more about centering in CSS here π.
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
Marked as helpful0@LuisGonzH94Posted 11 months ago@MelvinAguilar I really appreciate your comments! About the h1 tag, it's great that you mention that it can only be used once per page so as not to confuse screen readers (accessibility). Thanks for letting me know about the overflow: hidden. I'll try it and see how it turns out. In addition to your comments about centering the content, I was thinking about using display flex, but my question is: should I use it inside the body selector?
I will surely consider this in my next challenge project. I will also implement your suggestions in my coding right away. I truly appreciate your comments.
0 - You don't necessarily need to add border--radius to every column Instead, you can use set to the container parent and use
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