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

              
                <p><b>Click inside this frame, then press tab to see the focus states.</b></p>

<div class="button-container">
  <button class="custom-button example-1">Example 1</button>
</div>
  
<div class="button-container">
  <button class="custom-button example-2">Example 2</button>
</div>

<div class="button-container">
  <button class="custom-button example-3">Example 3</button>
</div>
  
<div class="button-container">
  <button class="custom-button example-4">Example 4</button>
</div>

              
            
!

CSS

              
                /* Remove the dotted outline in Firefox */
.custom-button:not(.default)::-moz-focus-inner {
  border-style: none;
}

.example-1:focus {
  
  /* Adds a white border around the button, along with a blue glow. The white and blue have a color contrast ratio of at least 3:1, which means this will work against any background color. */
  box-shadow: 0 0 0 2px #ffffff, 0 0 3px 5px #3a97f9;
  
  /* NOTE: box-shadow is invisible in Windows high-contrast mode, so we need to add a transparent outline, which actually does show up in high-contrast mode. */
  outline: 2px dotted transparent;
  outline-offset: 2px;
}

.example-2:focus {
  /* Adds a white border along with a black outline. The contrast ratio between the black and white greater than 3:1, which means this will work against any background color. */
  border: 2px solid #FFFFFF;
  outline: 2px solid #000000;
  
  /* We're using `outline`, which doesn't support rounded corners. When we adjust the border-radius to match, the design looks more deliberate. */
  border-radius: 0;
}

.example-3:focus {
  /* Inverts the colors */
  background: #FFFFFF;
  color: #590CE5;
  
  /* Adds an underline so we're not relying on color alone to signify change */
  text-decoration: underline;
  
  /* This is okay to remove, ONLY because of the changes we made above. */
  outline: none;
}

.example-4:focus {
  /* Adds an underline. This is visible, but might be a bit too subtle to recognize. */
  text-decoration: underline;
  
  /* This is okay to remove, ONLY because of the changes we made above. */
  outline: none;
}

              
            
!

JS

              
                  
              
            
!
999px

Console