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 using Flex

coinfilipā€¢ 130

@coinfilip

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


Hello. Here's my solution to Challenge #10.

Notes: First time using ::after pseudo-element for the hover state, and I hope I made a good implementation of it somehow. Swapped the <img> element that has the equilibrium image to <section> as MDN states that <img> doesn't support ::after.

Community feedback

@SadeeshaJayaweera

Posted

Using the ::after pseudo-element for hover states is a creative way to enhance your web design. Swapping the <img> element for a <section> element to support the ::after pseudo-element is a valid approach. However, it's essential to ensure that your implementation works effectively and maintains accessibility. Here are a few points to consider:

  1. Accessibility: Make sure that the content you're swapping is still accessible. If the image you replaced conveyed meaningful content, ensure that this content is accessible to users who rely on screen readers or cannot view images. You might use the aria-label attribute to provide a text description.

  2. Semantic Structure: Ensure that the use of a <section> element is semantically appropriate for the content you're representing. Semantically correct HTML improves accessibility and SEO.

  3. CSS: Verify that your CSS implementation for the ::after pseudo-element is effective and works as intended on various browsers and screen sizes. Cross-browser testing is crucial.

  4. User Experience: Test your implementation thoroughly to ensure that it enhances the user experience and doesn't introduce any usability issues.

  5. Performance: Consider the impact on page load times. Depending on the size and number of images you're replacing, this technique may have performance implications. Ensure that it doesn't significantly slow down your website.

In summary, using the ::after pseudo-element for hover states and swapping the <img> element for a <section> element can be a valid approach, but it's important to pay attention to accessibility, semantics, CSS compatibility, user experience, and performance to ensure a successful implementation.

Marked as helpful

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