My goal is to create a modal window using CSS. I am working on adding a stylish element for users who have JavaScript disabled, which will be displayed using the noscript tag.
Here is what I currently have:
<div id="ns-overlay">
<section>
<h1>Example Title</h1>
<h3>Subtitle Here</h3>
<p>
Sample content goes here.
</p>
</section>
</div>
And this is the corresponding CSS:
#ns-overlay{
width: 100%;
height: 100%;
background: rgba(52, 52, 52, 0.5);
position: fixed;
z-index: 10000;
background-image: url('../imgs/ns-overlay.png');
padding-top: 95px;
}
#ns-overlay section{
color: #FFF;
width: 990px;
margin: auto;
background: rgba(52, 52, 52, 0.9);
padding: 10px;
box-sizing: border-box;
}
#ns-overlay section h1,
#ns-overlay section h3,
#ns-overlay section p{
padding: 5px;
background: #126D4F;
/*background: linear-gradient(135deg, rgb(11, 104, 73) 0%, rgb(11, 78, 130) 100%);*/
margin: 5px;
}
#ns-overlay section h1{
width: 560px;
background: #126D4F;
}
#ns-overlay section h3{
width: 510px;
background: #0B4F82;
}
#ns-overlay section p{
background: none;
}
I would like the overlay to disappear when the user clicks on it.