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

Solution NFT preview card with Flex and Grid - By IsNeonPlay

#bem
IsNeonPlay 220

@IsNeonPlay

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


// ESPAÑOL // En si el reto fué sencillo en si, pero en el hover de la imagen se me complicó bastante... No supe muy bien el como centrar de forma vertical me frustré bastante en esa parte y pues intenté improvisar un poco para que intentara quedar bien en el diseño movil y escritorio, pero no pude... Acepto sugerencias y criticas constructivas para saber como pude resolverlo mejor...

pd: Se que el uso de flex y grid son innecesarios en la descripción de la tarjeta, pero es bueno saber como funcionan de forma armoniosa juntos.

// ENGLISH // The challenge itself was simple, but in the hover of the image it got quite complicated... I didn't know very well how to center vertically, I got quite frustrated in that part and so I tried to improvise a bit so that it would try to look good in the mobile and desktop design, but I couldn't... I accept suggestions and constructive criticism to know how I could solve it better...

ps: I know the use of flex and grid are unnecessary in the card description, but it's nice to know how they work harmoniously together.

Community feedback

@BasharKhdr1992

Posted

Your solution is great. However, regarding the hover effect, you can improve it using the follwing steps:

  1. Set the position of the image as relative.

  2. Set the position of the overlay as absolute.

  3. The overlay element should take the whole width and height of the the overlaid element. This achieved by the following: .nft-img-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; height: 100%; width: 100%; border-radius: 12px; background-color: hsl(178, 100%, 50%); opacity: 0; transition: opacity 0.5s; }

  4. And finally for centering the eye icon inside the overly I used the following: .nft-icon-view { position: absolute; opacity: 0; top: 42.5%; left: 42.5%; } 4.1. I used positioning with the icon because I did not want the opacity of the overlay to affect the eye as well. For more information on overlaying visit the following link: Image overly icon

Marked as helpful

1

IsNeonPlay 220

@IsNeonPlay

Posted

@BasharKhdr1992 I really appreciate it too much, I hadn't thought about that at the time of making the code, for a similar test I'll try to apply it. Thank you!

1

@Kamasah-Dickson

Posted

  • Your solution looks great and very closer to the design .
  • It also looks great on mobile and text are also readable.

What I have for you is that flex box and Grid are very necessary in making responsive design so don't worry about when to use them.

Besides good job there 👍👍 Happy coding👍💻

Marked as helpful

1

@dostonnabotov

Posted

Hi, there. That looks great! I think what you should do first is center the card no matter what screen size. Add these on your body: display: grid; place-items: center; It will keep your card in the center in both x and y directions. Also, set min-height: 100vh in your body. Check out my solution and code if you want to. Good luck!

1

IsNeonPlay 220

@IsNeonPlay

Posted

@dostonnabotov Thank you very much for the recommendation, I will apply it in future challenges!

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