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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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="btnWrapper">
  <button class="pri_btn">Button</button>
  <button class="sec_btn">Button</button>
  <button class="tri_btn">Button</button>
  <br /><br />
  <button class="pri_btn bigBtn">Button X2</button>
  <button class="sec_btn bigBtn">Button X2</button>
  <button class="tri_btn bigBtn">Button X2</button>
</div>

<div class="btnWrapper greyBg">
  <button class="pri_btn iconBtn"><i class="material-icons">open_in_new</i>Button</button>
  <button class="sec_btn iconBtn"><i class="material-icons">open_in_new</i>Button</button>
  <button class="tri_btn iconBtn"><i class="material-icons">open_in_new</i>Button</button>
  <br /><br />
  <button class="pri_btn bigBtn iconBtn"><i class="material-icons">open_in_new</i>
    Button X2</button>
  <button class="sec_btn bigBtn iconBtn"><i class="material-icons">open_in_new</i>Button X2</button>
  <button class="tri_btn bigBtn iconBtn"><i class="material-icons">open_in_new</i>Button X2</button>
</div>

<div class="btnWrapper">
  <div class="splitBtn"><button class="pri_btn">Button</button><button class="pri_btn drop"><i class="material-icons">arrow_left</i>
    </button></div>
  <div class="splitBtn"><button class="sec_btn">Button</button><button class="sec_btn drop"><i class="material-icons">arrow_left</i>
    </button></div>
  <div class="splitBtn"><button class="tri_btn">Button</button><button class="tri_btn drop"><i class="material-icons">arrow_left</i>
    </button></div>
  <br /><br />
  <div class="splitBtn bigBtn"><button class="pri_btn">Button</button><button class="pri_btn drop"><i class="material-icons">arrow_left</i>
    </button></div>
  <div class="splitBtn bigBtn"><button class="sec_btn">Button</button><button class="sec_btn drop"><i class="material-icons">arrow_left</i>
    </button></div>
  <div class="splitBtn bigBtn"><button class="tri_btn">Button</button><button class="tri_btn drop"><i class="material-icons">arrow_left</i>
    </button></div>
</div>
              
            
!

CSS

              
                :root {
  --bgColor: #0fddaf;
  --txtColor: #ffffff;
  --borColor: rgba(0, 0, 0, 0);
  --sizeVar: 8px;
}
button {
  font-family: "Roboto", sans-serif;
  font-size: calc(var(--sizeVar) * 1.75);
  font-weight: 500;
  border: none;
  outline: none;
  margin: var(--sizeVar);
  padding: var(--sizeVar) calc(var(--sizeVar) * 2);
  border-radius: calc(var(--sizeVar) / 2);
  cursor: pointer;
  background-color: var(--bgColor);
  color: var(--txtColor);
  box-shadow: 0 0 0 1px var(--borColor) inset;
}
.sec_btn {
  --bgColor: #869cff;
}
.tri_btn {
  --bgColor: #ffffff;
  --txtColor: #4b4760;
  --borColor: #cccccc;
}
button:focus {
  --borColor: rgba(0, 0, 0, 0.4);
}
button:hover {
  --bgColor: #1fcc9e;
}
.sec_btn:hover {
  --bgColor: #6279e7;
}
.tri_btn:hover {
  --bgColor: #f8f7f8;
}
button:active {
  --bgColor: #1db284;
}
.sec_btn:active {
  --bgColor: #5468c7;
}
.tri_btn:active {
  --bgColor: #e7e7e7;
}

.btnWrapper {
  padding: 20px 20px 0 20px;
  margin: 20px;
  height: fit-content;
}
.greyBg {
  background-color: #f6f6f6;
}
.splitBtn {
  margin: var(--sizeVar);
  width: fit-content;
  float: left;
}
.splitBtn button {
  margin: 0;
  border-radius: calc(var(--sizeVar) / 2) 0 0 calc(var(--sizeVar) / 2);
}
.splitBtn .drop {
  padding: var(--sizeVar) calc(var(--sizeVar) * 1.5);
  border-radius: 0 calc(var(--sizeVar) / 2) calc(var(--sizeVar) / 2) 0;
  margin-left: calc(var(--sizeVar) / -8);
}
.splitBtn button:focus {
  transform: translateZ(calc(var(--sizeVar) / 8));
}
.drop .material-icons {
  transform: rotate(-90deg) scale(2) translateX(calc(var(--sizeVar) / -8));
}
.splitBtn:nth-of-type(4) {
  clear: left;
}
.bigBtn {
  transform: scale(2);
  margin: calc(var(--sizeVar) * 7);
}
.bigBtn.iconBtn,
.splitBtn.bigBtn {
  margin: calc(var(--sizeVar) * 7.5);
}
.iconBtn i {
  margin-right: calc(var(--sizeVar) / 2);
}
@font-face {
  font-family: "Material Icons";
  font-style: normal;
  font-weight: 400;
  src: url(https://example.com/MaterialIcons-Regular.eot); /* For IE6-8 */
  src: local("Material Icons"), local("MaterialIcons-Regular"),
    url(https://example.com/MaterialIcons-Regular.woff2) format("woff2"),
    url(https://example.com/MaterialIcons-Regular.woff) format("woff"),
    url(https://example.com/MaterialIcons-Regular.ttf) format("truetype");
}
.material-icons {
  font-size: calc(var(--sizeVar) * 1.5);
  transform: translateY(calc(var(--sizeVar) / 8));
}
body {
  user-select: none;
}

              
            
!

JS

              
                  
              
            
!
999px

Console