cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

              <button id="show" class="btn"  title="Show dialog">Show dialog</button>
  <dialog class="dialog dialog-default">
    <button  id="close" class="btn btn-close" title="Close dialog">X</button>
    <h2>Never miss our newsletters!</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sollicitudin, justo eu consequat rutrum, leo tellus euismod quam, et consectetur nibh nunc vitae risus. Vestibulum auctor nunc dolor, et hendrerit elit aliquet at.</p>
    <form method="dialog">

      <input class="input" placeholder="Enter Email (not really)" />

      <button type="submit">Confirm</button>
              .btn {
  cursor: pointer;
.input {
  width: 100%;
  font-size: 1.6rem;
  padding: 0.4rem 0.8rem;
  margin: 0.8rem 0;

.dialog-default::backdrop { /* native */
  background: hsla(0,0%,6%,.97);
.dialog-default + .backdrop { /* polyfill */
  background: hsla(0,0%,6%,.97);

.dialog-default {
  max-width: 400px;
  margin: 0 auto;
  padding: 6rem 4rem;
  border-radius: .4rem;
  background: #222729;
  background-image: radial-gradient(circle at 50% 0,#2e3437,#1d2223);
  box-shadow: 0 0 .1rem rgba(0,0,0,.3);
  color: white;
  text-align: center;
  border: 0;
  position: relative;

.dialog-default .btn-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: transparent;
  color: white;
  font-size: 1.8rem;
  outline: 0;
               const dialog = document.querySelector( "dialog" ),
          showBtn = document.querySelector( "#show" ),
          closeBtn = document.querySelector( "#close" );

    showBtn.addEventListener( "click", e => dialog.showModal(), false );
    closeBtn.addEventListener( "click", e => dialog.close(), false );
Loading ..................