Modal dialog (coming soon)

under construction


<a href="#modalDialog" class="modalBtn" id="modalTrigger">Click me to open</a>

<dialog class="modal" id="modalDialog" tabindex="-1">
  <div>
    <a href="#modalTrigger" class="close" aria-label="Close dialog">×</a>
    <p>Hello Beautiful!</p>
  </div>
</dialog>

CSS:


.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  opacity: 0;
  visibility: hidden;
}
.modal p {
  font-size: 1.5em;
}

.modal > div {
  background: wheat;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  height: 120px;
  padding: 1em;
  position: relative;
  width: 50%;
}

.modal:target {
  opacity: 1;
  visibility: visible;
}

body {
  font-family: monospace;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  min-height: 100vh;
}

a.modalBtn {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  background-color: #c69;
  border: none;
  padding: 1.5em;
  max-width: 30%;
  color: white;
  -webkit-transition-duration: .25s;
          transition-duration: .25s;
  text-align: center;
  text-decoration: none;
  font-size: 1.25em;
}
a.modalBtn:hover, a.modalBtn:focus {
  background-color: #993366;
}

.close {
  background-color: transparent;
  position: absolute;
  top: .2em;
  right: .5em;
  font-size: 1.5em;
  cursor: pointer;
  text-decoration: none;
}
.close:hover, .close:focus {
  color: #c69;
}

Sources: You might not need js