I have simply following html + css code:
Someone knows why div with button is still hidden? I added z-index
function myFunction() {
console.log('Clicked')
}
div{
color: yellow;
position: relative;
z-index: 1000;
}
div:after{
content: '';
background: red;
padding: 100px;
position: absolute;
left: 0;
z-index: 999;
}
<div>
<button onclick="myFunction()">Click me</button>
</div>