JSFiddle - React, Tailwind, and code Playground

by jashwant

HTML

<div id='overlay'></div>
<p id='layer'>This is layer</p>

CSS

#overlay {
  position:fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  z-index: 1;
  background-color: #d6d6d6;
}
#layer {
    z-index: 2; 
    background: white;
    width: 300px;
    height: 300px;
    position: absolute;
    top: 20px;
    left: 20px;
  
}

JavaScript

$('#overlay').click(function(e) {
    alert('code to hide your layer'); 
});