
A dead simple CSS library which lets you create modal windows using pure CSS/CSS3. Powered by :target and :before pseudo classes. Animated with CSS3 transitions and transforms.
How to use it:
Load the primary CSS file modal.css in your document’s head section.
<link rel="stylesheet" href="css/modal.css">
Create the modal content as this:
<div class="modal" id="demo">
<div class="modal-container">
<p>I love cats</p>
<a href="#modal-close">Close</a>
</div>
</div>Create a link to toggle the modal window.
<a href="#demo">demo</a>
That’s it. Override the default CSS styles to your taste.
p { margin-top: 0; }
.modal-container {
position: fixed;
background-color: #fff;
width: 70%;
max-width: 400px;
left: 50%;
padding: 20px;
border-radius: 5px;
-webkit-transform: translate(-50%, -200%);
-ms-transform: translate(-50%, -200%);
transform: translate(-50%, -200%);
-webkit-transition: -webkit-transform 200ms ease-out;
transition: transform 200ms ease-out;
}







Hello, is there any way to auto load the modal window on page load instead of clicking a button or a link? Thank you!