So, I was going to make an overlay thing for my website where an element is fixed over the site and placed above everything. But this means that nothing else behind the element can be effected.
Here's a JSFiddle reproducing this problem.
You'll notice that you cannot highlight the black text, and the JavaScript event doesn't fire.
Here is the CSS + HTML I've used to create this problem:
HTML
<div id="main-container">
<div id="container-content">You can't highlight me! D:</div>
<div id="container-fixed"><div style="margin:90px auto;background:red;width:40px;height:40px;"></div>You cannot highlight the text behind this DIV. It also doesn't fire click events.</div>
</div>
main-container
: This holds the content.
container-content
: This is the content behind the fixed DIV
container-fixed
: This is the DIV the overlaps "container-content"
CSS
#main-container {
width: 90%;
margin: 5%;
position: relative;
height: 500px;
overflow: auto;
}
#container-content {
width: 100%;
height: auto;
}
#container-fixed {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
color: red;
}
Is what I'm trying to achieve even possible? Both CSS and JavaScript (jQuery) answers are allowed.