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 - Card

Alessio Valastroβ€’ 190

@AlessioValastro

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

EcePJDβ€’ 200

@EcePJD

Posted

First of all, you can update your solution in the 'Design Comparison' by clicking the 'Generate New Screenshot' (Red - Pinkish button). Second, I didn't see the horizontal scroll bar on your solution (you might've fixed it already).

Child elements overflow because the overall width / height ( or both) they occupy is more than the width / height of the container resulting to a scroll bar. Based on my experience, even though you set the width and height of these child elements to equal or less than the container's size by using parent-dependent units ( e.g.percentage '%') and the parent element does not have a specified size, it will not apply. You must specify your parent element's size first (e.g. px).

If incase my analysist about child elements are wrong and you still did not figure how the scroll bar is appearing, you can hide it by setting the parent's overflow attribute to 'hidden'.

Reference: (overflow)https://www.w3schools.com/css/css_overflow.asp

Marked as helpful

0
Abdul Khaliq πŸš€β€’ 72,660

@0xabdulkhaliq

Posted

Hello there πŸ‘‹. Congratulations on successfully completing the challenge! πŸŽ‰

  • I have some recommendations regarding your doubts that I believe will be of great interest to you.

SUGGESTION πŸ’‘:

  • "i don't know why in the design comparison, my solution is different from the actual site ?", Let me share my css snippet which i applied to your solution to help your solution to look same as design, i'm not kidding let me explain.
  • Add the following style rules to your css file
.container {
   display: grid;
   grid-template-columns: 1fr 1fr;
}

.image-desktop {
  width: 100%;
}
  • Now remove the display: inline-flex from .container, And i just explain what we done above.
  • We just used Grid layout like a pro for .container to get a desired output as same as design and applied width: 100% for .image-desktop which helps to cover the image
  • Now your component will be perfectly look as same as design image as you wished.

.

I hope you find this helpful πŸ˜„ Above all, the solution you submitted is great !

Happy coding!

Marked as helpful

0
MetalRickβ€’ 70

@MetalRick84

Posted

Hello.

Wich browser do you use for testing? I reviewed your solution with

  • Opera-devtools: horizontal scroll

and with

  • Chrome: looks fine

Maybe its a problem with devtools in Opera

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