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 using Flexbox

@Nairitya

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


I would like to know how to make the desktop version responsive so that when I resize the window the height grows accordingly instead of content overflowing. Thanks.

Community feedback

Lucas 👾 104,420

@correlucas

Posted

Hello Monk, congratulations for your solution.

Answering your questions:

Your component isn't responsive due the fixed value you've set for the width for the container/columns. If you set witdth: 600px; for an element, the css will understand that the element should be the value(600px) you've set not more not less. Use max-width inside the .container so when you resize the window the container content could contract to fit the screen space. Note that you can also use min-width depending of the situation.

Pay attention also to the container height, there's no need to set a height because the component height will resize with the spaces from the elements padding/margin as the h1, p, button. You've used height:100vh; inside the container and this will make the component grows a lots. Add min-height:100vh; to the body instead.

I hope this helps you improve your solution, happy coding 👊

Marked as helpful

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