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 card component

Ha Anna 20

@its-haanna

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 spent more time making the image hover the way it should than I am willing to admit. What are other solutions to this? Is there a way to do it more efficiently and clean?

Community feedback

Sang Le 520

@sqle157

Posted

Hi,

Congratulations on completing your challenge! For your question, you can try to use pseudo element ::after or ::before instead of having another img tag in your code.

For example, this is how I'm gonna handle the image hover

.art-div::after {
	content: ''; // you can also put the image as the content in here
	display: none;
	position: absolute;
	inset: 0;
	border-radius: 0.75rem;
	background: url(./images/icon-view.svg), hsl(178, 100%, 50%, 0.5);
	background-repeat: no-repeat;
	background-position: center;
}

.art-div:hover::after {
	display: block;
}

I hope this answers your question!

Happy coding and good luck with further challenges!

Marked as helpful

0

Ha Anna 20

@its-haanna

Posted

@sqle157 Thanks for the tip, I'll look into it!

0
bunee 2,020

@buneeIsSlo

Posted

Hey! @its-haanna, The App looks great and responds well. I think you need to work on CSS positions, This video is a great place to start from.

Hope this helps :)

Marked as helpful

0

Ha Anna 20

@its-haanna

Posted

@buneeIsSlo Thank you, I'll definitely check the link out!

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