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

Eríck 130

@Erick-SL

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


What specific areas of your project would you like help with?

I believe this code is very bad, I didn't know how to do the separation in CSS very well. Maybe a flexbox would be ideal. I still lack knowledge. I accept study tips and related things. Thank you for your help!!!!

Community feedback

Chirag 370

@chirag-bishnoi

Posted

That float:right; is the culprit, remove that and that width:360px too! They're messing up the layout. If you want to divide the section between the articles equally the just use grid, like this:

section{
display:grid;
grid-template-columns: 1fr 1fr;
}

and that will do the job 👍

Marked as helpful

1

Eríck 130

@Erick-SL

Posted

@chirag-bishnoi Thanks, I was learning better about the grid... I'll keep trying... thanks for the great tip!

1
Daniel 🛸 44,230

@danielmrz-dev

Posted

Hello @Erick-SL!

Your project looks great!

I have a suggestion about that might interest you:

📌 You can use the <picture> tag when you have different versions of the same image.

Using the <picture> tag will help load the correct image to the user's device, saving bandwidth and improving performance.

Example:

<picture>
    <source media="(max-width: 460px)" srcset="{desktop image path here}">
    <img src="{mobile image path here}" alt="{alternative text here}">
</picture>

I hope this helps!

Other than that, excellent work!

Marked as helpful

1

Eríck 130

@Erick-SL

Posted

Thanks for the tip @danielmrz-dev

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