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

              
                <a href="#samplemodal">Show modal</a>

<div id="samplemodal" class="modal-contain">
  <a href="#" class="modal-close"></a>
  <div class="modal">
    <a href="#">X</a>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus hendrerit augue eu tincidunt sollicitudin. Morbi bibendum enim vel mauris ultrices volutpat. Nam imperdiet ultrices faucibus. Vivamus mattis tempus ipsum, sit amet faucibus tortor porta at. Sed tincidunt mauris in risus euismod adipiscing. Nullam ullamcorper arcu sit amet odio sodales, et sollicitudin ipsum eleifend. Proin mattis nunc aliquet diam varius porta. Donec pellentesque non metus ut bibendum.</p>
  </div>
</div>
              
            
!

CSS

              
                @import "compass/css3";

.modal-contain {
  display: none;
}

.modal-contain:target {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.75);
}

.modal-close {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: default;
}

.modal {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  margin: 0 auto;
  width: 25em;
  padding: 1em;
  background: #fff;
}
              
            
!

JS

              
                
              
            
!
999px

Console