Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

3-column preview card component (HTML & CSS)

Luis H. Gonz.β€’ 20

@LuisGonzH94

Desktop design screenshot for the 3-column preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

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

Daniel πŸ›Έβ€’ 44,230

@danielmrz-dev

Posted

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 a max-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 helpful

0

Luis H. Gonz.β€’ 20

@LuisGonzH94

Posted

@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

@MelvinAguilar

Posted

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 that Sedans, SUVs and Luxury 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 helpful

0

Luis H. Gonz.β€’ 20

@LuisGonzH94

Posted

@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

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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