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

Challenge 2 || NFT card

@SachinMulgir

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


I am a beginner. I tried and got some doubts to ask:

  1. How to put the card at the very center by reducing its size. I can add margin to the top and bottom of the card that'll provide some spacing. But i want to make it all happen on the viewport only, no extra scrolling.
  2. How to add image effect on hovering over the image. I am new and yet to learn that part. If anyone interested to drop any suggestions, I am all open to it. Thank You.

Community feedback

@AbdelrhmanX7

Posted

Hi Sachin you can use width: 400px instead of 30% because he percentage value is change by body width change example if i have body width value 1000px and i use width 30% for main element now if body width change from 1000px to 500px the main element will change from 300 to 150px and sometimes that not be perfect to element on your website. you can use specific width value like 250px and this value will never change by body width value change

Marked as helpful

0
Travolgi 🍕 31,420

@denielden

Posted

Hi Sachin, I took some time to look at your solution and you did a great job!

Also I have some tips for improving your code:

  • add descriptive text in the alt attribute of the image
  • You can add the effect :hover creating a div that appears on hover. I used tailwind but you can still see and understand which css properties you can use to do the same. Look here -> my solution
  • to make it look as close to the design as possible set width:20rem to container class
  • remove all margin from .container class because with flex they are superfluous
  • add min-height: 100vh to body because Flexbox aligns child items to the size of the parent container

Overall you did well 😉

Hope this help and happy coding!

Marked as helpful

0

@mathanraj0601

Posted

Hi sachin, 1, you can use Flexbox to center the card. 2, you can create a color overlay by placing the image in separate div with display none and when hover make display to block. hope its helps you:)

Marked as helpful

0

@SachinMulgir

Posted

Thankyou for the feedback. @mathanraj0601

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