Design comparison
Solution retrospective
Could not figure out the view icon on hover.
Community feedback
- @PhoenixDev22Posted about 2 years ago
Hi Nugget,
Congratulation on finishing this challenge. Great job on this one! I see you have received some incredible feedback. Adding to what @vanzasetia said:
HTML
- You should use
<main>
for the card and<footer>
for the attribution. HTML5 landmark elements are used to improve navigation experience on your site for users of assistive technology.
- Page should contain a level-one heading. In this challenge, you can have
<h1>
visually hidden withsr-only
class.
- The link wrapping the equilibrium image should either have
Sr-only
text, anaria-label
oralt
text that says where that link takes you.
- For any decorative images, each img tag should have empty
alt=""
and addaria-hidden="true"
attributes to make all web assistive technologies such as screen reader ignore those images inicon-clock, icon-ethereum
.
- Profile images like that avatar are valuable content. The alternate text should not be avatar .You can use the creator's name
Jules Wyvern
. Read more how to write an alt text .
- You have used
<br>
, using<br>
is not only bad practice, it is problematic for people who navigate with the aid of screen reading technology. Screen readers may announce the presence of the element. This can be a confusing and frustrating experience for the person using the screen reader. You can read more in MDN.
- It’s not recommended to use
<br>
to increase the gap between lines of text Or make empty space between elements, usepadding / margin
styling via CSS. And about using <br> in the<p>
to make the paragraph break in new line, You may usemax-width
to<p>
and remove those<br>
.
- If you wish to draw a horizontal line, you should do so using appropriate CSS. You may remove the
<hr>
, you can useborder-top:
to the avatar's part.
- There are so many ways to do the hover effect on the image, The one I would use is pseudo elements
::before, ::after
. You can use pseudo-elements to change the teal background color to hsla. Then the opacity can be changed from 0 to 1 on the pseudo element on the hover. Also using pseudo elements makes your HTML more cleaner as there's no need for extra clutter in the HTML. The icon view does not really need to be in the HTML. You can use CSS for it.
- Adding
rel="noopener"
orrel="noreferrer"
totarget="_blank"
links. When you link to a page on another site usingtarget=”_blank”
attribute, you can expose your site to performance and security issues.
Hopefully this feedback helps.
Marked as helpful2@NuggxtPosted about 2 years ago@PhoenixDev22 Wow! Thank you for the feedback. i will definitely review my code and fix all of my mistakes.
0 - You should use
- @vanzasetiaPosted about 2 years ago
Hi, Nugget! 👋
Regarding the hover effect of the NFT image, I would recommend getting the HTML right first.
- Wrap the image with either an anchor tag or
button
. The choice depends on what you think will happen after the users click the image. If it is navigating then use an anchor tag but if it is triggering an element like showing modal then thebutton
element would be the choice. - After that, the interactive element needs text content. You can use the alternative text of the image as the text content for the link or button. Another option is to use
aria-label
attribute.
Now, after the HTML is done, we can move the styling.
- For overlay, I suggest using pseudo-elements rather using HTML elements. This way, the HTML markup doesn't contain decorative elements.
- Then, create a pseudo-element from the interactive element.
- After that, make the pseudo-element cover the entire image.
- Then, for the
:hover
effect (a:hover::after
), usebackground
properties to show the eye icon and the cyan background color. - Lastly, for the cyan background color I suggest using the
hsla
color format. Then, for the alpha value, reduce it to0.6
.
That's it! I hope you find this useful! 🙂
Marked as helpful2@NuggxtPosted about 2 years ago@vanzasetia Thank you for the feedback. I will definitely study more on pseudo -elements. and work on my HTML some more.
0 - Wrap the image with either an anchor tag or
- @correlucasPosted about 2 years ago
Hello Nugget, congratulations for your solution!
I did this challenge and in thst time I've used this tutorial to make the icon hover effect.
https://www.w3schools.com/howto/howto_css_image_overlay_icon.asp
I think if you read it in realloa matter of 5 min you'll be able to setup this effect in your challenge too. 👨💻Here's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/solutions/nft-preview-card-vanilla-css-custom-design-and-hover-effects-b8D1k9PDmX
Hope this helps you, happy coding
Marked as helpful1
Please log in to post a comment
Log in with GitHubJoin 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