This looks like it should be possible, but the solution has eluded me for too long. Can you make a link clickable in a background revealed through a hole cut in a scrollable div using mix-blend-mode? I've tried the usual trick of pointer-events:none
, but this doesn't work because the 'hole' is not really transparent, and probably also because the background is actually two levels down.
Here's my code so far:
<div style="height:400px;width:300px;margin:0 auto;background-image: repeating-linear-gradient(45deg, white 0px,#ebebeb 60px);border:1px solid grey;overflow:scroll;position:relative;">
<div style="padding:20px"><span>
lorem ipsum amet sit dolor lorem ipsum amet sit dolor lorem ipsum amet sit dolor lorem ipsum amet sit dolor lorem ipsum amet sit dolor lorem ipsum amet sit dolor lorem ipsum amet sit dolor lorem ipsum amet sit dolor lorem ipsum amet sit dolor lorem ipsum amet sit dolor lorem ipsum amet sit dolor lorem ipsum amet sit dolor
</span>
<br>
<br>
<a href="http://www.stackoverflow.com">Stack Overflow</a>
</div>
<div style="height:100%;width:100%;background:white;mix-blend-mode:hard-light;position:absolute;top:0;left:0;overflow:scroll">
<div style="height:300px"></div>
<div style="width: 90%;height: 50px;margin: 0 auto 0;border: solid 1px red;border-radius: 10px;background:grey;pointer-events:none;"></div>
<div style="height:2000px"></div>
</div>
</div>
If you scroll the content, you will see the background content come in to view - with a link - but I can't work out how to make the link clickable (if it's possible).
Thanks for any suggestions. A JS/Jquery solution would be fine, though straight CSS is the first preference.
This should work: