Latest solutions
Latest comments
- @JairthSubmitted over 2 years ago@danielbrahPosted over 2 years ago
For the hover state, I would change the following code:
.card__img:hover::before { display: block; }
to this:
.card__img:hover::before { opacity: 0.4; }
Under the
.card__img::before
selector, change the following properties:opacity: 0.4;
toopacity: 0;
, anddisplay: none;
todisplay: block
Then you can add your transition for the opacity property! The transition does not work for the display property. The display property was basically swapped for the opacity property in the hover state for
.card__img::before
.Marked as helpful1