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

              
                <div class="wrap">
  <h2>Button Examples <span>Hover over each one</span></h2>
  <div class="colWrap colFour">
     <div class="col">
       <button class="button button-example1">Go Here</button>
     </div>
     <div class="col">
       <button class="button button-example2">Send this form</button>
     </div>
     <div class="col">
       <button class="button button-example3">Enquire Now</button>
     </div>
     <div class="col">
       <button class="button button-example4">Visit this page</button>
     </div>
  </div>
  <div class="colWrap colFour">
     <div class="col">
       <button class="button button-example5">Continue</button>
     </div>
     <div class="col">
      
     </div>
     <div class="col">
      
     </div>
     <div class="col">
       
     </div>
  </div>
</div>
              
            
!

CSS

              
                /**
 * Buttons
*/
$envelope-movement: 0.3em;
@keyframes send {
  0% {transform: translateX(0);}
  7% {transform: translateX($envelope-movement);}
  21% {transform: translateX(-$envelope-movement);}
  35% {transform: translateX($envelope-movement);}
  49% {transform: translateX(-$envelope-movement); opacity: 1;}
  100% {transform: translateX(5em); opacity: 0;}
}

@keyframes sendrev {
  0% {transform: translateX(5em); opacity: 0;}
  25% {transform: translateX(5em); opacity: 0;}
  100% {transform: translateX(0); opacity: 1}
}

.button {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  outline: none;
  cursor: pointer;
  
  &-example1 {
    border: 0.2em solid #000;
    background: none;
    padding: 0.5em 2em;
    font-size: 120%;
    position: relative;
    transition: color 0.3s ease;
 
    &:before {
      content: '';
      color: #fff;
      padding: 0.5em 2em;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: -1;
      background: #F5218A;
      transform: scaleY(0);
      transition: transform 0.3s ease;
      transform-origin: 50% 100%;
    }
    
    &:hover {
      color: #fff;
      &:before {
        transform: scaleY(1);
      }
    }
  }
  
  &-example2 {
    line-height: 2em;
    font-size: 120%;
    color: #e57b09;
    
    &:after {
      animation: sendrev 0.7s normal forwards linear;
      content: '';
      width: 1.3em;
      height: 1em;
      position: relative;
      top: 0.2em;
      display: inline-block;
      background: url('data:image/svg+xml;utf8,<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="19px" viewBox="4 3.25 24 19" enable-background="new 4 3.25 24 19" xml:space="preserve"><path fill="#e57b09 "  d="M25.75,3.25H6.25C5.013,3.25,4,4.263,4,5.5v15c0,1.237,1.013,2.25,2.25,2.25h19.5c1.237,0,2.25-1.013,2.25-2.25v-15 C28,4.263,26.987,3.25,25.75,3.25z M13.345,13.149L7,18.092V6.335L13.345,13.149L13.345,13.149z M8.134,6.25h15.732L16,12.156	L8.134,6.25z M13.593,13.415L16,16l2.407-2.585l4.935,6.335H8.658L13.593,13.415L13.593,13.415z M18.655,13.149L25,6.335v11.757	L18.655,13.149L18.655,13.149z"/></svg>') center no-repeat;
      margin-left: 0.5em;
      transform: translateX(5em);
    }
    
    &:hover {
      &:after {
        animation: send 0.7s normal forwards linear;
      }
    }
  }
  
  &-example3 {
    line-height: 2em;
    font-size: 120%;
    font-weight: 500;
    
    &:after {
      content: '';
      width: 1.3em;
      height: 1.2em;
      position: relative;
      top: 0.2em;
      display: inline-block;
      background: url('data:image/svg+xml;utf8,<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="20.572px" viewBox="0 0 24 20.572" enable-background="new 0 0 24 20.572" xml:space="preserve"><path d="M14.926,20.069l8.572-8.571c0.669-0.669,0.669-1.755,0-2.425l-8.572-8.571c-0.669-0.669-1.755-0.669-2.424,0c-0.67,0.67-0.67,1.755,0,2.425l5.645,5.645H1.714C0.768,8.571,0,9.339,0,10.286C0,11.232,0.768,12,1.714,12h16.433l-5.645,5.646C12.167,17.979,12,18.419,12,18.857s0.167,0.877,0.502,1.212C13.171,20.739,14.257,20.739,14.926,20.069z"/></svg>') center no-repeat;
      margin-left: 0.5em;
      left: 0;
      transition: left ease 0.3s;
    }
    
    &:hover {
      &:after {
        left: 0.5em;
      }
    }
  }
  
  &-example4 {
    background: none;
    padding: 1em 2em;
    font-size: 120%;
    position: relative;
    display: block;
    transition: transform 0.3s ease, top 0.3s ease;
    color: #fff;
    transform-style: preserve-3d;    
    background: #508E26;
 
    &:before {
      content: '';
      position: absolute;
      transition: all 0.3s;
      height: 40%;
      left: 0;
      right: 0;
      top: 100%;
      background: #3A671C;
      transform-origin: 0% 0%;
      transform: rotateX(-90deg);
      transition: margin 0.3s ease;
      z-index: -1;
    }
    
    &:hover {
      transform: rotateX(15deg);
    }
    
    &:active {
      top: 0.1em;
      
      &:before {
        margin-top: -0.2em;
      }
    }
  }
  
  &-example5 {
    position: relative;
    padding: 1em 4em 1em 2em;
    background: #EF6D00;
    color: #fff;
    
    &:before,
    &:after {
      content: '';
      display: block;
      position: absolute;
      right: 1em;
      top: 50%;
      margin-top: -0.7em;
      width: 1.4em;
      height: 1.4em;
      transform: rotate(-45deg);
      transition: transform 0.5s ease, margin 0.5s ease;
      border: solid #fff;
      border-width: 0 0 0.2em;
    }
    &:before {
      border-width: 0 0.2em 0 0;
    }
    
    &:hover {
      &:before {
        transform: rotate(45deg);
      }
      &:after {
        transform: rotate(225deg);
        margin-top: -0.8em;
      }
    }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console