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 component

MrDeveloper01010β€’ 240

@istfredy

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 do you think about it ?

Community feedback

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

@0xabdulkhaliq

Posted

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

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

COMPONENT MEASUREMENTS πŸ“:

  • Use min-height: 100vh for body instead of height: 100vh. Setting the height: 100vh may result in the component being cut off on smaller screens.
  • For example; if we set height: 100vh then the body will have 100vh height no matter what. Even if the content spans more than 100vh.
  • But if we set min-height: 100vh then the body will start at 100vh, if the content pushes the body beyond 100vh it will continue growing. However if you have content that takes less than 100vh it will still take 100vh in space.

.

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

Happy coding!

Marked as helpful

0

MrDeveloper01010β€’ 240

@istfredy

Posted

@0xAbdulKhalid Hello and Thank you very much, I learn a few things new :)

0
Bader Idrisβ€’ 2,900

@Bader-Idris

Posted

you can put both prices into a div and give that div display: relative, and its children position: absolute;, then you can modify top and left of these prices, especially the crossed one. I hope it's helpful.

to Summarize:

div.parent {
  display: relative;
}
div.parent .children {
  display: absolute;
}
div.parent  :last-child {
  left: 30px ;
}
0

MrDeveloper01010β€’ 240

@istfredy

Posted

@Bader-Idris Thank you, But i hadn't seen on the design that in fact the two prices are perfectly on the same line.πŸ˜… In the future I will observe the design more carefully.🀠

0

@VCarames

Posted

@Bader-Idris @ MrDeveloper01010

There’s no need to use absolute / relative in this challenge. Especially for the prices. Just place both prices inside a div and apply flex along with align-items: center and finally give it a gap.

1
MrDeveloper01010β€’ 240

@istfredy

Posted

@vcarames This is true :)

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