@vanzasetia
Posted
Hello, Mustapha! 👋
Regarding your question, we need to get the HTML right first.
- Wrap the
img
element with an interactive element. You can wrap it with an anchor tag. - Then, add alternative text to the image. The alternative text should be the label for the link. So, if the
href
attribute is the file path to the image then the alternative text is "Preview Equilibrium".
After that to create the overlay, I recommend creating it with pure CSS using pseudo-element and background
properties.
- First, create a pseudo-element from the anchor tag.
- Make the pseudo-element fill the entire image.
- Lastly, on hover (
a:hover::before
), add the cyan background color and the eye icon. - For the cyan background color, use
hsla
(orrgba
) color format to control opacity.
That's it! I hope this helps!
Marked as helpful
@Farouk-ayo
Posted
@vanzasetia Thank you for the tip. i got it fixed now
@vanzasetia
Posted
@eff-r-k
You are welcome!
I expected that you would use background-color
for the cyan background color since it is not a gradient color.
Also, what is the purpose of opacity: 3
? I tried toggling it and it looks like there's no difference whether or not the opacity
exists.