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

NFT Design

@SheikBazith

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


Any suggestions on this would be greatly appreciated.

Community feedback

Ahmed El_Bald 1,020

@Ahmed-Elbald

Posted

Hello there,

I think you did a great job with this challenge. I just have some notes that might find helpful:

  • You need to increase spacing between elements a little bit as, right now, your elements are crushed into small space.

  • Your solution lacks some features when it comes to accessibility. You should wrap the whole card in an article element as it seems like a standalone element (it gives meaning on its own).

  • In a real-world application, the text "Equilibrium #3429" won't be your h1. Therefor, I suggest using an h2 or h3 for that.

  • When presenting the price and the days left, you can use a dl element whereas hiding the terms using a .visually-hidden class, so that it makes sense for disabled users. It should be something like that:

    <dl>
      <dt class='visually-hidden'>Product price</dt>
      <dd>0.041ETH</dd>
      <dt class='visually-hidden'>days left</dt>
      <dd>3 days left</dd>
    </dl>
    

    You can find more about the dl element here. You can also read about the .visually-hidden class here

Marked as helpful

1

@SheikBazith

Posted

@Ahmed-Elbald thank you so much. dl tag sounds really helpful. I will work more on that. I am still not sure how to create layout of designs as I feel that's the hardest part. So using where to use article, main, etc. is bit confusing. Will work more on it.

If possible can u send some tutorial which can help me work on point 2 which is accessibility of the layout.

0
Ahmed El_Bald 1,020

@Ahmed-Elbald

Posted

@SheikBazith

Unfortunately, most tutorials focus on creating the design and making it look good for normal users. There's almost no tutorials talking about accessibility in a serious and organized way.

I would see this is the only video on YouTube that is worth watching concerning that matter. However, I think the HTML Spec is your only friend here. It has all that you want to know.

0

@SheikBazith

Posted

@Ahmed-Elbald I agree. Most tutorial teach us how to make it look more attractive rather than make it more accessible. Will check the links u sent. Thanks

0
Daniel 🛸 44,230

@danielmrz-dev

Posted

Hello @SheikBazith!

Your project looks great!

It's quite a challenge to add that hover effect with the image overlay properly. But here's how you can do it:

HTML

<img src="images/image-equilibrium.jpg" alt="Equilibrium" class="pic">
  <div class="icon">
    <img src="images/icon-view.svg" alt="icon-view" class="icon-view">
  </div>

CSS

.pic {
   width: 300px;
   background: url('images/icon-view.svg') center center no-repeat;
   background-color: $Cyan-hover;
   background-size: cover;
   margin: auto;
   border-radius: 10px;
}
.icon {
   display: grid;
   justify-content: center;
   align-items: center;
   position: absolute;
   opacity: 0;
   background-color: $Cyan-hover;
   width: 300px;
   height: 300px;
   border-radius: 10px;
}
icon:hover {
   opacity: .5;
   cursor: pointer;
}

Just don't forget to change the class names to match yours.

I hope it helps!

Other than that, you did an excelent job!

1

@SheikBazith

Posted

@danielmrz-dev Thank you for taking the time and show me how its done. Really appreciate it.

1

@SheikBazith

Posted

@danielmrz-dev I made those changes. background: url('images/icon-view.svg') center center no-repeat; background-color: $Cyan-hover; background-size: cover; margin: auto; border-radius: 10px;

But i could do it even without adding these lines. Is there any purpose we should add them?

1
Daniel 🛸 44,230

@danielmrz-dev

Posted

@SheikBazith

These lines are necessary to place the icon view correctly. Like in the same place as the main image. In summary, to get the exact same result as the design 😊

1

@SheikBazith

Posted

ah got it @danielmrz-dev

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