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 created using css +html

Naglaa Raslanβ€’ 460

@codeAndcocoa

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


Is there anything you think is missing in my solution? Does my solution look good on both desktop / mobile screens?

p.s: if you open my live URL and find no colors, please wait for a minute or two and refresh the page

thanks in advance :)

Community feedback

Daniel Bardaβ€’ 240

@daniel-barda

Posted

Hi,

I haven't checked on mobile, but on desktop, the layout is not displayed correctly because you forgot to set grid-template-columns in .product-box-grid.

Additionally, I highly recommend avoiding the use of pixels (px).

This is because pixels do not respect the user's browser font size.

I suggest always using rem instead.

Furthermore, I'm attaching an article that could be very helpful for your future projects.

Good luck moving forward! 😊

Pixels vs. Relative Units

62.5% Font Size Trick

Marked as helpful

0

Naglaa Raslanβ€’ 460

@codeAndcocoa

Posted

Thank you for your feedback, I appreciate it πŸ™‚ πŸ™‚

For the desktop layout, I set the grid columns property in the media queries section, not the main one and it works fine with me so kindly wait for a couple of minutes then refresh the page.

Concerning the pixels(px) I am not sure if you mean that I used pixels in the font-size property because I used (em) and (vw) for this one. and for the articles thank you very much I will read them of course; πŸ™‚ @daniel-barda

0
Daniel Bardaβ€’ 240

@daniel-barda

Posted

@naglorias

You should define grid-template-columns in .product-box-grid, not only in media query.

This is because media queries are conditions that define how the CSS code will behave according to the screen size.

Therefore, setting the grid column values ​​in a media query will only be valid for a certain screen size.

Instead, you need to set the grid-template-columns property in the class Selector ("main"), which, in our case, is .product-box-grid.

This will make them valid for any screen size, and then we'll use a media query to adapt our layout to different screens.

Now I will answer the second part.

You did use rem.

But note that in class .product-box-grid you used

max-width: 860px;
height: 580px;

For values ​​of this type I would recommend using rem.

Of course, small things like border-radius: 9px or letter-spacing: 5px; It is fine using px because it is a small value.

I hope it is now makes more sense to you.

In addition, I recommend reading the article I attached to you earlier, the trick of 62.5% font size.

I'm sure it will help you a lot in the future.

Marked as helpful

1
Naglaa Raslanβ€’ 460

@codeAndcocoa

Posted

Oh yes, I get your point and everything make sense now and thank you for the articles and for your help @daniel-barda

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