Pen Settings



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


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


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.


  CSS Injection
    Now on CodePen!

<p>Try this:</p>

  <li>Open a modal: <button class="modal-button">Open Modal</button></li>
  <li>Change the modal style in the CSS</li>
  <li>Notice the modal stays open!</li>

<p>The page doesn't refresh entirely when making only CSS changes. Only when changing HTML or JS. That means the state of the page is maintained (a full refresh would have closed the modal. Also, FASTER!</p>

<div id="modal">
<div class="modal">
  <h3>I'm a modal. Go ahead and style me.</h3>
  <p>I won't up and close on you.</p>
  <button class="modal-button">Close Modal</button>
<div id="overlay"></div>


// (when the modal is open)

.modal {
  background: white;
  border: 5px solid #f06d06;
  box-shadow: 0 0 50px rgba(black, 0.5);
  padding: 30px 80px;
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5000;
#overlay {
  content ""
  position: absolute;
  top 0
  left 0
  right 0
  bottom 0
  background rgba(#f06d06, 0.75)

  text-align center;
  font: 100%/1.4 Georgia
  max-width: 600px;
  padding: 10px;
  margin 0 auto

  span {
    display: block;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1rem;
    margin: 0.5rem;

  list-style-position: inside;

#modal {
  display: none;


                var buttons = document.querySelectorAll(".modal-button");
var modal = document.getElementById("modal");

[] document.querySelectorAll('.modal-button'), function(el) {
   el.addEventListener('click', function() {
     if ( == "block") { = "none"
     } else { = "block"
  }, false);