A
A
ABOBA_2932u42021-06-21 15:20:44
css
ABOBA_2932u4, 2021-06-21 15:20:44

How to make hover cover an image?

When the background does not cover the picture
It is necessary like this:
60d0840bde281543585555.png
Code:
https://jsfiddle.net/0jqfm42e/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-06-21
@ABOBA_2932u4

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-withinand :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 .blurif the user is focused).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question