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 Preview Component v1 - HTML, BEM CSS

Sarah Soares• 30

@sarahsoaressilva

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


What did you find difficult while building the project?

  • Identify the right spaces between the items.

Which areas of your code are you unsure of?

  • The selector at .overlay is not working to change the view icon img on .overlay:hover to a stronger opacity than .overlay. This is something that i will check again later.

Do you have any questions about best practices?

  • Should be used ::after for this overlay effects or position: absolute?

Community feedback

Vanza Setia• 27,795

@vanzasetia

Posted

Hi, Sarah Soares! 👋

You can use hsla or rgba color format to only reduce the opacity of the cyan color. This way, the eye icon can have opacity: 1.

I have a few suggestions for improving your solution.

  • Replace the <article class="card"> with <main>. All the page content should live inside landmark elements. <article> is not a landmark element.
  • Use interactive elements for any elements that have interactivity. Interactive elements can either be links or buttons.
  • For your information, anchor tags are for navigation. The <button> element is for an action like opening a modal, submitting a form, toggling an element, etc. It is essential to use the correct elements.
  • Wrap the text with a meaningful element like a paragraph element. There should not be text in <span> and <div> alone.
  • Use rem or em instead of px for font sizes. Never use px unit. Relative units such as rem and em can adapt when the users change the browser's font size setting. Learn more — Why you should never use px to set font-size in CSS

I recommend creating the overlay of the Equilibrium using pseudo-element and absolute positioning; use both of them. This way, the HTML can be simpler. You can see the solution from @IlnaraAckermann as your reference: Frontend Mentor | Css3, HTML5, flexbox, pseudo-class and pseudo-elements coding challenge solution

I hope you find this useful. Have fun coding! 😄

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