Design comparison
Community feedback
- @Call4juliusPosted 12 months ago
I noticed you didn't get the
image:hover;
state?Do you need any assistance?
Marked as helpful0@anonto42Posted 12 months agoi'm add that img:hover but that was not warking at this time , that is my bad luck and thanks for responce @Call4julius
0@Call4juliusPosted 12 months ago@anonto42 you were suppose to use a
::before
or::after
pseudo-element on the image.In the pseudo-element add a
url(images/vision-icon.svg)
as content.Give the pseudo-element a
display: grid;
,position: absolute;
andplace-content: center
also give the pseudo-element abackground-color: hsl(--- -- --)
andopacity: 0;
and of course you will need to set the position of the pseudo-element. For ease just useinset: 0;
that is top, right, bottom, left set to 0.Finally write a new declaration like this
image:hover::before {opacity: 0.5;}
N.B: The
::before
and::after
pseudo-element is like adiv
that you don't write in your html mark-up. You can style it just like you style every otherdiv
with position, width and height, background-color etc.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