Design comparison
Solution retrospective
What was challenging for me
- adding the hover effect on the main image. Would really appreciate a feedback on the method I used and whether or not it is a good practice.
- To keep my code DRY, I used a utility class to add the hover effect on the title and the creator's name. However, this led me to using !important, which I was taught to avoid. So I'm open to any suggestion.
Any suggestions on how I can improve are welcome!
Community feedback
- @PhoenixDev22Posted about 2 years ago
Hello lamy,
Congratulation on completing this challenge. Great job on this one! I have few suggestions regarding your solution:
HTML
- The most important part in this challenge interactive elements. Since there's a :hover state on the image and means it's interactive, So there should be an interactive element around it. When you create a component that could be interacted with a user , always remember to include interactive elements like(button, textarea,input, ..)
for this imagine what would happen when you click on the image, there are two possible ways:
1: If clicking the image would show a popup where the user can see the full NFT, here you use<button>
. 2:If clicking the image would navigate the user to another page to see the NFT, here you can use<a>
.
You should have used
<a>
to wrapEquilibrium #3429
andJules Wyvern
too.- The link wrapping the equilibrium image should either have
Sr-only
text, anaria-label
oralt
text that says where that link takes you.
- Profile images like that avatar are valuable content. The alternate text should not be empty (or set aria-hidden="true"). You can use the creator's name
Jules Wyvern
. Read more how to write an alt text .
- 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.
For your question, you might want to read this article about !important or CSS Guidelines !important
Great job on this one! Hopefully this feedback helps.
Marked as helpful1@Lamy237Posted about 2 years agoHi @PhoenixDev22 !
Thanks again for your feedback. It really helps me improve.
I've been focusing so much on adding the active states that it didn't cross my mind that these could be links. After following your suggestions, I ended up not needing the utility class anymore, so no more !important.
However, I noticed a weird behaviour when increasing the browser's font-size to very large. The little icons of eutherum and clock are too small, which might be a problem for really big screens. Is there a way to fix that or do we just need bigger images?
0 - The most important part in this challenge interactive elements. Since there's a :hover state on the image and means it's interactive, So there should be an interactive element around it. When you create a component that could be interacted with a user , always remember to include interactive elements like(button, textarea,input, ..)
for this imagine what would happen when you click on the image, there are two possible ways:
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