I just stumbled upon this situation where the hidden area of โโthe overflow element still depends on mouse clicks or mouse clicks.
I thought that an invisible element or region would not be targeted at mouse events, so what am I missing here?
Following the example, when this behavior appears, you just need to move the mouse outside the circle, but next to the green square, and you will notice that the hover selector is valid.
#circle { position:absolute; height: 50%; width: 28%; left: 50%; top: 50%; transform: translate(-50%, -50%); background: black; color: white; border-radius: 200px; overflow: hidden; } #square { height: 50%; width: 50%; transform: translate(-50%, -50%); background: green; cursor: pointer; } #square:hover { background: yellow; }
<body> <div id="circle"> <div id="square"></div> </div> </div>
Added on 2016-12-05 . This strange behavior does not occur, as noted in the comments in Firefox, unlike Chrome.
Cheers, utxeee.
source share