Design comparison
Solution retrospective
Hi everyone! Any feedback is appreciated, please let me know there's anything I overlooked.
I also have a question about my overlay:
The height of my hover overlay is longer than the NFT image. In dev tools, I determined it to be 5px longer. I assumed this might be because there's no fixed height specified on the containing div
, but I'm not sure what's causing it to be longer. Please give me some advice on if there's a way to ensure that they're the exact same size.
Community feedback
- @LukaKobaidzePosted almost 3 years ago
Hello!
To remove extra space to the container, you can add
display: block
to the image with the class ofnft-img
If you want to know why this happens and why we add
display: block
to the image, check out thisMarked as helpful2@sheronimoPosted almost 3 years ago@LukaKobaidze Hi Luka! I completely forgot about
img
elements being inline, changing it todisplay: block
did the trick!Thank you very much! πΉ
1 - @PhoenixDev22Posted almost 3 years ago
Hello @sheronimo ,
I have some suggestions regarding your solution:
-
for the image hover, first it should be wrapped in an anchor tag as already stated. You can add
either
aria labelor
Sr onlytext or
alt`` text on the image that says where the link goes. -
The eye image doesn't really need to be in the html, you could do it with css.
-
You can use an unordered list
<ul>
to wrapclass="nft-info"
and in each list item would be<img>
and<p>
. -
No need for the
<hr class="divider" />
, you can useborder-top: ;
to theclass="nft-author"
. Also , to use more semantic tags , you can use<figure >
and<figcaption>
for class="nft-author"`.
Hopefully this feedback helps.
Marked as helpful1@sheronimoPosted almost 3 years ago@PhoenixDev22 Hi Phoenix, thanks for all the suggestions, I really appreciate it! Great pointers for my markup (and thus, styling) to be more efficient.
Definitely will work on these in my continued development, and in future projects as well. πΉ
0 -
- @NaveenGumastePosted almost 3 years ago
Hay ! shuberber Good Job on challenge
These below mentioned tricks will help you remove any Accessibility Issues
-> Always use the "alt attribute" and just leave it empty bt.. always add it with img tag.
-> Learn more on accessibility issues
Keep up the good work!
Marked as helpful1@sheronimoPosted almost 3 years ago@Crazimonk Hi Naveen, thank you for the tip! I made sure to include the
alt
attribute in the smaller icons too in my update. π1 - @denieldenPosted almost 3 years ago
Hi Shuberber, great work !
Add
aspect-ratio: 1;
for exact same size to the.overlay
classAnd don't forget
img
element needalt
attribute, it's very importantHope this help ;)
Marked as helpful1@sheronimoPosted almost 3 years ago@denielden Hi Deniel,
I decided to use a
display: block
on the image, since I completely overlooked it being an inline element, but thank you for this suggestion! It's a new method for me to experiment with πThanks too for the heads-up on the
alt
attributes! πΉ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