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 card

@ali007-depug

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


now Edit it with clean code and better than it first

Community feedback

Lucas 👾 104,420

@correlucas

Posted

Hello Ali, congratulations for your solution!

I saw your repository files and I've some tips for you:

A standard name for the main css file is style.css maybe you can create your new projects with this kind of naming instead of indexcss.css

I saw that you've used a lots of id for styling is a best practice use only class for styling and id for forms or content that needs Javascript.

Hope it helps, happy coding!

Marked as helpful

1

@ali007-depug

Posted

@correlucas i read on some article that you should use class for parent and id for child , is this true, also i will do my best and try to take your advice , thank you very much. would you think my style is matching the design? i see there is issue in button..but when i run my live site i dont see this problem, can you help?

0
Azhar 600

@azhar1038

Posted

Hi Ali, congratulations on completing the challenge!

You can try using <picture> and load the image based on media query instead of loading both images, something like this:

<picture title="Perfume bottle">
          <source media="(min-width:40em)" srcset="./images/image-product-desktop.jpg">
          <img src="./images/image-product-mobile.jpg" alt="Perfume bottle">
</picture>

I also noticed this media query: screen and (min-width: 375px) and (max-width: 400px) Now because of this in screen smaller than 375px, your design falls back to desktop mode and breaks. You don't need that min-width and also update your max-width

You are using fixed height and width on images, try to use max-width for image so that your card can be more responsive in smaller screen.

Your button is also overflowing your card, so you need to update your spacing.

Hope it helps :)

1

@ali007-depug

Posted

@azhar1038 thank you for advice i'm grateful.. i will take your advice to make my design better, but in overflow button , i don't see this problem when i run this from my live site on githup or in my vscode ?

0
Azhar 600

@azhar1038

Posted

@ali007-depug That is weird. You can even see in the screenshot generated above that your button is going outside the card

Marked as helpful

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