Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="wrap">
  <h1>Pure <span>CSS</span> Modal Popup</h1>
</div>

<div class="modal">
  <input id="modalTrigger" type="checkbox">
  <label for="modalTrigger">Launch Modal</label>
  <div class="modalOverlay">
    <div class="modalWrap">
      <label for="modalTrigger">&#10006;</label>
      <h2>This is your modal content</h2>
      <p>Lorem ipsum dolor sit amet, ea stet atomorum consectetuer ius. Tota ancillae eum id. Cu sale docendi his. Et his labitur nominati tractatos, alia fastidii iracundia duo ea. Ex has veritus prodesset, vix eros forensibus quaerendum cu, per et hendrerit adipiscing. Usu tota offendit explicari te, an aeque scripta comprehensam usu, sale tacimates antiopam id has.</p>
      <p>Molestie offendit eam eu, sed facer falli omittam cu, ut has volutpat iracundia. Pro ubique gubergren scriptorem et, vel impetus honestatis te. Virtute ceteros contentiones duo et, id tota similique pro, qui an volumus luptatum sensibus. Nec eu odio invenire intellegat, audire suscipiantur signiferumque no mel. Et lorem alienum interpretaris pro.</p>
    </div>
  </div>
</div>
              
            
!

CSS

              
                html {
  margin: 2em;
  background: #efefef;
}

.modal {
  background: #fff;
  box-shadow: 0 0 3px rgba(0,0,0,0.15);
  display: inline-block;
  padding: 1em;
}

.modal > label {
  background: #ffd300;
  border: 1px solid #f0c600;
  border-radius: .2em;
  color: #000;
  cursor: pointer;
  display: inline-block;
  font-weight: bold;
  padding: 0.75em 1.5em;
  text-shadow: 1px 1px 1px #fff;
  transition: all 0.55s;
}

.modal > label:hover {
  transform: scale(0.97);
}

.modalOverlay {
  background: #999;
  right: 50px; left: 50px;
  margin: 0 auto;
  position: fixed;
  text-shadow: none;
  z-index: -100;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.75s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modalWrap {
  padding: 1em 0;
  position: relative;
  margin: 0 auto;
  width: 95%;
}

.modalWrap > label {
  float: right;
  cursor: pointer;
}

input {
  position: absolute;
  top: -1000px
}

input:checked ~ .modalOverlay {
  opacity: 1;
  transform: scale(1);
  z-index: 800;
}
              
            
!

JS

              
                
              
            
!
999px

Console