Design comparison
Solution retrospective
Hi! Been doing a couple challenges here the last few days getting more comfortable and feeling better as a result of the practice, would love to get some feedback. I'm not very sure about the way I managed to get the cyan and eye icon over the main image to appear, it works, but I feel it's not the best way to do it. Thanks!
Community feedback
- @PhoenixDev22Posted over 2 years ago
Hello @LorenzoChio,
Glad to hear you’re getting comfortable. “Practice practice, and practice ” is the key.
Great work . I have some suggestions regarding your solution:
HTML
- Since there's a :hover state on the image and means it's interactive, So there should be an interactive element around them. 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 use
<a>
.-
The link wrapping the equilibrium image should either have Sr-only text, an aria-label or alt 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 in(icon-view , icon-ethereum, icon-clock
). -
look up a bit more about how and when to write alt text on images. Learn the differences with decorative/meaningless images vs important content
-
For
class="data "
you can use an unordered list<ul>
.In each<li>
, there should be<img>
and<p>
that way you can align them centrally. -
If you wish to draw a horizontal line, you should do so using appropriate CSS. Remove the
<hr/>
, you can use border-top: to the avatar's part -
The avatar's alt should not be Artist's picture, it's meaningless. You can use the creator's name Jules Wyvern. Read more how to write an alt text
-
To use more semantic tags , you may use
<figure>
and<figcaption>
for the avatar's part.
CSS:
-
There are so many ways to add the hover effect on the image , The one I would use, using pseudo-elements to change the teal bg color to a hsla. Then opacity can be changed from 0 to 1 on the pseudo element on hover.(As there's no need for another clutter in the HTML.The
<div>
and<img>
) -
add
min-height: 100vh
to the body that let the body grows taller if the content outgrows the visible page -
width: 345px;
an explicit width is not a good way . consider using max-width to card instead. -
Consider using rem and em units as they are flexible, specially for font size If your web content font sizes are set in absolute units, such as pixels, the user will not be able to re-size the text or control the font size based on their needs. Relative units “stretch” according to the screen size and/or user’s preferred font size, and work on a large range of devices.
-
Remember a css reset on every project. That will do things like set the images to display block and make all browsers display elements the same.
-
Really important to keep css specificity as low/flat as possible. The best way to select the html elements for styling is single class selectors.
Overall , your solution is great.
Marked as helpful1@LorenzoChioPosted over 2 years ago@PhoenixDev22 Wow, thank you so much for all the feedback, I'll come back to this comment often while working on future challenges.
1
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