Design comparison
Solution retrospective
This challenge was certainly just that for me. Can someone please help me out with the icon overlay hover opacity?? I could not figure out how to get the cyan background to be someone see-through but not the eye image itself.
And I'm open to all other feedback! This CSS felt all over the place for me, so I'm sure there are a lot of things that could have been done better.
Community feedback
- @PhoenixDev22Posted over 2 years ago
Hi Kenisa,
Congratulation on completing this challenge.
Excellent work! I see you have received some incredible feedback .If you don't mind, I have few suggestions regarding your solution:
HTML
-
The icon-view doesn’t really need to be in the HTML as there's need for extra clutter in the HTML . You can use CSS for it
-
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"
attribute to make all web assistive technologies such as screen reader ignore those images in(icon-view, icon-ethereum, icon-clock
).
-
If you wish to draw a horizontal line, you should do so using appropriate CSS. You may remove the
<div class="hr"></div>
, you can useborder-top:
to the avatar's part. -
To use more semantic tags , you may use
<figure>
and<figcaption>
for the avatar's part. -
The avatar's alt should not be creator profile pictureit’s meaningless. You can use the creator's name
Jules Wyvern
. Read more how to write an alt text -
For middle part of the card
class="details"
, you can use an unordered list<ul>
, in each<li>
there should be<img>
and<p>
that way you can align them centrally.
- Adding
rel="noopener"
orrel="noreferrer"
totarget="_blank"
links. When you link to a page on another site using target=”_blank” attribute , you can expose your site to performance and security issues.
- 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.
Overall, Your solution is good. Hopefully this feedback helps.
Marked as helpful0 -
- @correlucasPosted over 2 years ago
Here I've placed the icon with a pseudo-element, maybe I don't have the best explanation, but are basically elements that you can apply before or after other element, without a need to add a code inside the html, in this case I used
content
and linked the icon url and manipulate its position withposition: absolute/relative
.img-container:before { content: url(./images/icon-view.svg); opacity: 1; transform: translate(119px, 127px); position: absolute; transition: opacity .2s ease-in-out; border-radius: 1rem; }
In the majority of cases I see people using it to add some decoration to a code, like a icon before a heading, or pattern background inside a container using a position that usually is not easy just with and element inserted in the html
Probably my explanation wasn't so good, so I let you there documentation:
https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements
Marked as helpful0@KenisaReneePosted over 2 years ago@correlucas oh the url in the content is something I hadn't thought of. I'll try it out! Thanks so much for all the extra info, Lucas!
0 - @correlucasPosted over 2 years ago
👾Hello Kenisa, congratulations for your solution!
I've inspected your code and I saw that you manage together the opacity for the hover effect and also for the svg icon, this is why also the icon gets the 60% transparency from the overlay itselft.
You can try to manage these opacity separately, or if doesnt work you can try to replace the icon with a pseudo-element.
I've managed the effect a little bit differently, but you can check my solution to have it as a reference if you want to:
https://www.frontendmentor.io/solutions/nft-preview-card-vanilla-css-custom-design-and-hover-effects-b8D1k9PDmX
Hope it helps and congrats for this amazing solution!
Marked as helpful0@KenisaReneePosted over 2 years ago@correlucas Thanks, Lucas! I tried working with a pseudo-element for the line and couldn't figure it out so I tried a different approach in the end. Pseudo-elements are still new to me, but I'll give your suggestion a shot and see if I can learn something new here.
0
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