Answer the question
In order to leave comments, you need to log in
How to make hover cover an image?
When the background does not cover the picture
It is necessary like this:
Code:
https://jsfiddle.net/0jqfm42e/
Answer the question
In order to leave comments, you need to log in
This is done in two layers. On the first - a picture, a title and all related information. On the second - buttons add to cart, share and like. Make the second layer initially hidden, draw it on top ( position: absolute
), hide ( opacity: 0; visibility: hidden;
). When ( :focus
, :focus-within
and :hover
) show ( opacity: 1; visibility: visible;
).
Perhaps adding JS to see if the cursor has been hovered over and then cleared from the card (in that order) to hide the second layer (do .blur
if the user is focused).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question