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 w/ Flexbox & @media

@paulaabro

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


Why is the layout breakpoint of 375px when the desktop box is 600px?

Community feedback

Lucas 👾 104,440

@correlucas

Posted

👾Oi Paula, tudo bem? Parabéns pelo desafio!

Muito boa a sua solução, toda estrutura do html e a semantica estao perfeitas. A unica coisa pra melhorar é a responsividade do card removendo todos width e substituindo por max-width a diferença entre width e max-width é que width é fixo e max-widthdeixa o card com um tamanho maximo mas pode diminuir tbm.Pra fazer com que a imagem totalmente responsiva, adicione display: block e max-width: 100% e object-fit: cover para fazer o corte automático da imagem ao redimensionar dentro da coluna:

img {
    display: block;
    object-fit: cover;
    max-width: 100%;
}

👋 Espero ter ajudado e continue no foco!

Marked as helpful

0
David 8,000

@DavidMorgade

Posted

Hello Paula, congrats on finishing the challenge! pretty good job!

To answer your question, I'm testing your project and it is working fine, the breakpoint is happening at 600px and not at 375px thanks for this selector:

  @media (min-width: 600px)
section {
  width: 600px;
  height: 450px;
  display: flex;
}

For the images, instead of using display: none, you can use the <picture></picture> tags with two <source> tags, and put the images there in the source tags, then you can render conditionally depending on the size of the screen, you can learn more about the picture tag here.

Hope my feedback helps you for future challenges!

Marked as helpful

0

@paulaabro

Posted

@DavidMorgade after I posted I taught better and changed the breakpoint...hahaha Found this <picture> tag facinating. Thanks for the tip

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