<input type="checkbox" id="modal">
<label for="modal" class="example-label">Open Modal</label>
<label for="modal" class="modal-background"></label>
<div class="modal">
<div class="modal-header">
<h3>Modal Title</h3>
<label for="modal">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAdVBMVEUAAABNTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU0N3NIOAAAAJnRSTlMAAQIDBAUGBwgRFRYZGiEjQ3l7hYaqtLm8vsDFx87a4uvv8fP1+bbY9ZEAAAB8SURBVBhXXY5LFoJAAMOCIP4VBRXEv5j7H9HFDOizu2TRFljedgCQHeocWHVaAWStXnKyl2oVWI+kd1XLvFV1D7Ng3qrWKYMZ+MdEhk3gbhw59KvlH0eTnf2mgiRwvQ7NW6aqNmncukKhnvo/zzlQ2PR/HgsAJkncH6XwAcr0FUY5BVeFAAAAAElFTkSuQmCC" width="16" height="16" alt="">
</label>
</div>
<p>Content for the modal</p>
</div>
Back to Snippets
Pure CSS3 Modal Example
Modals are basically dialog's that pop out when a user clicks a link, image, button etc. This example will show you how you can do it with pure CSS3, no JavaScript needed. The modal contains a title, content, and close button so users can close the dialog, as well as a background that will also close the dialog when clicked.
502