Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <fieldset>
  <legend>Roled-Up <code>&lt;div&gt;s</code></legend>
  <div role="button" tabindex="0" class="a">I am a fake button</div>
  <div role="button" tabindex="-1" class="a" aria-disabled="true">Disabled and fake</div>
  <div role="button" tabindex="0" class="b">Also fake</div>
  <div role="button" tabindex="0" class="c">Still fake</div>
  <div role="button" tabindex="0" class="d">Yep, fake</div>
</fieldset>

<fieldset id="Control">
  <legend>Native HTML Buttons (Control)</legend>
  <button type="button" class="a">I am a real button</button>
  <button type="button" class="a" disabled>Disabled and real</button>
  <button type="button" class="b">Also real</button>
  <button type="button" class="c">Still real</button>
  <button type="button" class="d">Yep, real</button>
</fieldset>

<fieldset id="MSFQ">
  <legend>Proprietary WHCM Feature Query</legend>
  <div role="button" tabindex="0" class="a">I am a fake button</div>
  <div role="button" tabindex="-1" class="a disabled" aria-disabled="true">Disabled and fake</div>
  <div role="button" tabindex="0" class="b">Also fake</div>
  <div role="button" tabindex="0" class="c">Still fake</div>
  <div role="button" tabindex="0" class="d">Yep, fake</div>
</fieldset>

<fieldset id="W3CFQ">
  <legend>Draft Forced Colors Feature Query</legend>
  <div role="button" tabindex="0" class="a">I am a fake button</div>
  <div role="button" tabindex="-1" class="a" aria-disabled="true">Disabled and fake</div>
  <div role="button" tabindex="0" class="b">Also fake</div>
  <div role="button" tabindex="0" class="c">Still fake</div>
  <div role="button" tabindex="0" class="d">Yep, fake</div>
</fieldset>
              
            
!

CSS

              
                body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.4;
}

fieldset {
  margin-top: 1em;
}

button {
  margin: 1em 0;
  font: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
}

[role="button"] {
  cursor: default;
  border: 1px solid #000;
  background-color: #eee;
  display: inline-block;
  padding: 0.25em 0.5em;
  margin: 1em 0.5em;
}

#Control button {
  margin: 1em 0.5em;
  padding: 0.25em 0.5em;
  border-width: 1px;
  border-style: solid;
}

[role="button"]:not([aria-disabled]):focus,
[role="button"]:not([aria-disabled]):hover,
#Control button:not([disabled]):focus,
#Control button:not([disabled]):hover {
  background-color: #333;
  color: #fff;
}

[role="button"][aria-disabled] {
  opacity: 0.3;
}

[role="button"].b,
[role="button"].c,
[role="button"].d,
#Control button.b,
#Control button.c,
#Control button.d {
  border: none;
  outline: none;
  border-radius: 0.5em;
  padding: 0.5em 1em;
  color: #fff;
  background: #00c;
  box-shadow: 0.2em 0.2em 0.1em rgba(0, 0, 0, 0.5);
}

[role="button"].b:focus,
[role="button"].b:hover,
[role="button"].c:focus,
[role="button"].c:hover,
[role="button"].d:focus,
[role="button"].d:hover,
#Control button.b:focus,
#Control button.b:hover,
#Control button.c:focus,
#Control button.c:hover,
#Control button.d:focus,
#Control button.d:hover {
  box-shadow: 0 0 0.1em #00c, 0.2em 0.2em 0.1em rgba(0, 0, 0, 0.8);
  color: #00c;
  background: #fff;
}

[role="button"].c {
  border: 1px solid transparent;
}

[role="button"].d {
  outline: 1px dotted transparent;
}

@media screen and (-ms-high-contrast: active) {
  #MSFQ [role="button"],
  #MSFQ [role="button"].a,
  #MSFQ [role="button"].b,
  #MSFQ [role="button"].c,
  #MSFQ [role="button"].d {
    border: 2px solid ButtonText;
    color: ButtonText;
    background-color: ButtonFace;
  }

  #MSFQ [role="button"].d {
    outline: none;
  }

  #MSFQ [role="button"][aria-disabled] {
    opacity: 1;
    color: GrayText;
    border-color: GrayText;
  }

  #MSFQ [role="button"]:focus,
  #MSFQ [role="button"].a:focus,
  #MSFQ [role="button"].b:focus,
  #MSFQ [role="button"].c:focus,
  #MSFQ [role="button"].d:focus {
    outline: 2px dashed ButtonText;
  }

  #Control button.b,
  #Control button.c,
  #Control button.d {
    border: 2px solid ButtonText;
    color: ButtonText;
    background-color: ButtonFace;
  }

  #Control button.b:focus,
  #Control button.c:focus,
  #Control button.d:focus {
    outline: 1px dotted ButtonText;
  }
}

@media screen and (forced-colors: active) {
  #W3CFQ [role="button"],
  #W3CFQ [role="button"].a,
  #W3CFQ [role="button"].b,
  #W3CFQ [role="button"].c,
  #W3CFQ [role="button"].d {
    border: 1px solid ButtonText;
    border: 1px solid ButtonBorder;
    color: ButtonText;
    background-color: ButtonFace;
  }

  #W3CFQ [role="button"].d {
    outline: none;
  }

  #W3CFQ [role="button"][aria-disabled] {
    opacity: 1;
    color: GrayText;
    border-color: GrayText;
  }

  #W3CFQ [role="button"]:focus,
  #W3CFQ [role="button"].a:focus,
  #W3CFQ [role="button"].b:focus,
  #W3CFQ [role="button"].c:focus,
  #W3CFQ [role="button"].d:focus {
    outline: revert;
    /*     outline: 2px dotted ActiveText; */
  }

  #W3CFQ [role="button"]:hover,
  #W3CFQ [role="button"].a:hover,
  #W3CFQ [role="button"].b:hover,
  #W3CFQ [role="button"].c:hover,
  #W3CFQ [role="button"].d:hover {
    border-color: GrayText;
  }

  #Control button,
  #Control button.a {
    outline: revert;
  }

  #Control button.b,
  #Control button.c,
  #Control button.d {
    border: revert;
    border-style: solid;
    border-width: 1px;
  }

  #Control button.b:focus,
  #Control button.c:focus,
  #Control button.d:focus {
    outline: revert;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console