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 using HTML, CSS(Flexbox).

John Carloโ€ข 170

@JohnCarloCanada

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


Didn't know to do with the other image product so i improvise for its picture during the mobile view.

Community feedback

Lucas ๐Ÿ‘พโ€ข 104,420

@correlucas

Posted

๐Ÿ‘พHello John Carlo, congratulations for your solution!

You're having an issue with the component version mobile, when it starts to scale down the text content starts to pop up from the container, because you've set a fixed height, if you want to avoid it just remove the height and let its contents as text and images give the container/div its height.

See what is causing the issue:

.Product-Box {
    /* height: 720px; */
}

Add the color white to the card component to give a little bit of contrast between the background and the card.

Hope it helps and happy coding!

Marked as helpful

0

John Carloโ€ข 170

@JohnCarloCanada

Posted

@correlucas Thanks sir for the advice it worked.

1
Lucas ๐Ÿ‘พโ€ข 104,420

@correlucas

Posted

@JohnCarlo952 You're welcome John!

0
Mike Odhiamboโ€ข 100

@MikeOdhiambo

Posted

Hi @JohnCarlo952. You could try having the image as the background image for that div, then when you're doing media queries, change the background URL to the mobile image.

Another option is to use the HTML image "srcset" attribute.

0

JOโ€ข 60

@myspace8

Posted

@MikeOdhiambo I tried to do that - apply the image in css using background image. But the image does not appear unless the div has has content like a text. Is there any way around that?

0
Mike Odhiamboโ€ข 100

@MikeOdhiambo

Posted

@myspace8 Giv the div height and width values.

0
John Carloโ€ข 170

@JohnCarloCanada

Posted

@MikeOdhiambo Thank sir, ill have this noted

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