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

Responsive Product preview card component

#foundation

@Smatsher

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 Everybody, this one was more challenging than the preview I did. Adding the media queries to adapt to the small screen was a little bit difficult, but I figure it out, and I think I did it great. I really appreciate any remark to improve this one and learn more about Frontend Development. Thanks in Advance for your advice.

Community feedback

Bernardus 1,115

@BernardusPH

Posted

Hello KLA MARIUS.

I see that you used the picture element but you used it as a parent for the text too. That is probably why you had so much trouble with the responsiveness. I got a good template to work off of.

html:

<body>
  <main>
    <div class="img-container>
     <picture>////code/////</picture>
    </div>

   <div class="text-content">
   /////code////
   </div>

  </main>
</body>

CSS

///this puts the card in the middle 
body{
min-height:100vh;
display:flex;
flex-direction:column;
justify-content:center;
align-items:center;
}

main{
width:80%; ///u can calculate this///
display:flex;

}
main >*{
flex:50%;

OR

width:50%;

//Whichever you choose
}

Now you can play with the width/height/font-size more rather than worry about the card.

Hope this helps. You can ask for more info if you want

Marked as helpful

1

@Smatsher

Posted

@BernardusPH Thanks for your suggestion. I will ask for question soon. I'm still learning, and this is my second challenge here, and I must learn more and have some expectation about the layout before asking for something that make sense. Don't want to ask just to ask :D

1
Bernardus 1,115

@BernardusPH

Posted

@Smatsher There is nothing wrong by asking. This is not StackOverflow where you get executed when asking questions so do not worry.

Most of us here are happy to help out

Marked as helpful

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