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 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 style="width: 600px; margin-bottom: 300px;">
  <div>
    <h4>Basic Button</h4>

    <button class="button">Basic Button</button>
  </div>

  <div>
    <h4>Colored Buttons</h4>

    <button class="button buttonRed">Red Button</button>
    <button class="button buttonGreen">Green Button</button>
    <button class="button buttonBlue">Blue Button</button>
  </div>

  <div>
    <h4>Button Sizes</h4>

    <button class="button buttonGreen buttonLarge">Large Button</button>
    <button class="button buttonRed buttonSmall">Small Button</button>
    <button class="button buttonBlue buttonXSmall">Xtra Small Button</button>
  </div>

  <div style="display: flex; flex-direction: column;">
    <h4>Block Buttons</h4>

    <button class="button buttonGreen buttonBlock">Block Button</button>
    <button class="button buttonRed buttonBlock">Block Button</button>
    <button class="button buttonBlue buttonBlock">Block Button</button>
  </div>


  <div>
    <h4>Disabled Buttons</h4>

    <button class="button buttonGreen disabled">Disabled Button</button>
    <button class="button buttonRed disabled">Disabled Button</button>
    <button class="button buttonBlue disabled">Disabled Button</button>
  </div>


  <div>
    <h4>Round Buttons</h4>

    <button class="button buttonGreen buttonRound">RB</button>
    <button class="button buttonBlue buttonRound">RB</button>
    <button class="button buttonRed buttonRound">RB</button>
  </div>

  <div>
    <h4>Raised Buttons</h4>

    <button class="button buttonGreen buttonRaised">Raised Button</button>
    <button class="button buttonRed buttonRaised">Raised Button</button>
    <button class="button buttonBlue buttonRaised">Raised Button</button>
  </div>

  <div>
    <h4>Animated Buttons(Hover effect)</h4>

    <button class="button buttonAnimHover buttonGreen">Anim Button (Hover)</button>
    <button class="button buttonAnimHover buttonRed">Anim Button (Hover)</button>
  </div>

  <div>
    <h4>Animated Buttons(Click effect)</h4>

    <button class="button buttonAnimClick buttonGreen">Anim Button (Click)</button>
    <button class="button buttonAnimClick buttonRed">Anim Button (Click)</button>
  </div>

</div>

              
            
!

CSS

              
                * {
  outline: none;
}

.button {
  padding: 6px 12px;
  margin-bottom: 0;
  font-weight: 400;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  display: inline-block;
  background-image: none;

  border-radius: 3px;
  box-shadow: none;
  border: 1px solid transparent;
}

.buttonRed {
  color: #fff;
  background-color: red;
  border-color: #ac2925;            
}

.buttonGreen {
  color: #fff;
  background-color: green;
  border-color: #4cae4c;
}

.buttonBlue {
  color: #fff;
  background-color: blue;
  border-color: #2e6da4;    
}

.buttonLarge {
  padding: 10px 16px;
  font-size: 18px;
}

.buttonSmall {
    padding: 5px 10px;
    font-size: 12px;    
}

.buttonXSmall {
    padding: 1px 5px;
    font-size: 12px;    
}

.button.disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.buttonRound {
  border-radius: 50%;
  height: 44px;
  width: 44px;
}

.buttonRaised {
  box-shadow: 0 3px 8px 0 black;
}

.buttonAnimHover.buttonRed:hover {
  color: #fff;
  background-color: #c9302c;
  border-color: #ac2925;
  box-shadow: 1px 1px 1px 3px grey;
}

.buttonAnimHover.buttonGreen:hover {
  color: #fff;
  background-color: #449d44;
  border-color: #398439;
  box-shadow: 1px 1px 1px 3px grey;
}

.buttonAnimClick.buttonRed:active {
  color: #fff;
  background-color: #3b0404;
  border-color: #ac2925;
}

.buttonAnimClick.buttonGreen:active {
  color: #fff;
  background-color: #022c02;
  border-color: #398439;
}

.buttonAnimClick.buttonBlue:active {
  color: #fff;
  background-color: #020221;
  border-color: #269abc;
}


              
            
!

JS

              
                
              
            
!
999px

Console