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

Product preview card component using CSS Flex πŸ’ͺ

Fahim Hossainβ€’ 290

@Mr-NotSoCreative

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hello Everyone!! πŸ‘‹ Here's my solution for Product preview card component challenge. I've used CSS display flex property to solve the challenge. If there are any mistakes or any room for improvement please let me know in the comment section. Thanky You!!! πŸ˜ƒ

Community feedback

romilaβ€’ 3,570

@romila2003

Posted

Hi Fahim,

Congratulations πŸŽ‰ for completing this challenge, your card looks great. The card is responsive.

  1. Your button tag is missing the type attribute which should be set to button or submit depending on its function.
  2. You have an HTML issue since you have included the p tag within the button tag which you can't do so after the img tag, you can just write the text.

Overall, great attempt and wish you the best for your future projects so keep coding πŸ‘.

Marked as helpful

1

Fahim Hossainβ€’ 290

@Mr-NotSoCreative

Posted

@romila2003 Thank you very much for reviewing my code. Solved the code according to your suggestion.

1
Lucas πŸ‘Ύβ€’ 104,420

@correlucas

Posted

πŸ‘ΎHello , Fahim, congratulations for your new solution!

I saw that you’ve used flexbox to place the content and create the layout.

I think the best way to build this component with two columns is by using GRID LAYOUT since it is simpler to manage the columns and then create the media query for mobile.

Here’s the steps to create it with grid create the main block to hold all the content (you can use <main> to wrap), set its width as max-width: 900px (it's the container size) and display: grid / grid-template-column: 1fr 1fr(this means that your component will have two columns with 50% of the container width each thats 450px).

Then to create the mobile version, all you need to do is to change the container flow vertically with grid-template-column: 1fr.

✌️ I hope this helps you and happy coding!

1

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