<button onclick="document.querySelector('#modal').showModal()">Click me</button>
<dialog id="modal">
O HAI!
<button onclick="this.parentNode.close()">Close</button>
</dialog>
/**
 * Native modal dialog (limited support)
 */

dialog::backdrop {
	background: rgba(0,0,0,.8)
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.