cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <a class="button" href="#">
  <span>Hover me</span>
  <span>Click me</span>
  <span>Thank you!</span>
</a>
            
          
!
            
              @import "bourbon";

$color-bg: #f08;
$color-text: #fff;
$color-button: #0ab;
$color-button-dark: darken($color-button, 20);

$width: 200px;
$height: 40px;
$perspective: 500px;
$speed: 0.5s; 

@import url(https://fonts.googleapis.com/css?family=Lobster);

%on {
  color: $color-text;
  background: $color-button;
  box-shadow: 0 20px 40px rgba(darken($color-bg, 20), 0.6);
}

%off {
  color: darken($color-text, 60);
  background: $color-button-dark;
  box-shadow: none;
}

html,
body {
  height: 100%;
  font: bold 18px "Lobster", Arial, sans-serif;

  @include perspective($perspective);
  @include linear-gradient($color-bg, lighten($color-bg, 15));
}

.button {
  position: fixed;
  top: 50%;
  left: 50%;
  margin-top: -$height;
  margin-left: -$width/2;
  width: $width;
  height: $height;
  
  cursor: pointer;
  text-decoration: none;
  text-shadow: 0 1px 1px $color-button-dark;
  
  @include transform-style(preserve-3d);
  @include transition(all $speed ease-in-out);
  
  span {
    display: block;
    border: 1px solid $color-button-dark;
    text-align: center;
    line-height: $height;
    
    @include transition(all $speed ease);
  }

  span:nth-child(1) {
    @extend  %on;
    @include transform-origin(bottom center);
    @include transform(rotateX(0deg));
  }

  span:nth-child(2) {
    @extend  %off;
    @include transform-origin(top center);
    @include transform(rotateX(-90deg));
  }
  
  span:nth-child(3) {
    @extend  %off;
    @include transform-origin(top center);
    @include transform(rotateX(-180deg) translateY($height) translateZ($height));
  }
}

.button:hover {
  @include transform(translateY(-$height));
  
  span:nth-child(1) {
    @extend  %off;
    @include transform(rotateX(90deg));
  }

  span:nth-child(2) {
    @extend  %on;
    @include transform(rotateX(0deg));
  }
  
  span:nth-child(3) {
    @extend  %on;
    @include transform(rotateX(-90deg));  
  }
}

.button:active {
  span:nth-child(2) {
    @extend %off;
    @include transform(rotateX(90deg));
  }
  
  span:nth-child(3) {
    @extend %on; 
    @include transform-origin(bottom center);
    @include transform(rotateX(0deg) translateY(-$height) translateZ($height));
  }
}

            
          
!
            
              /*
 * Customizable pure CSS animated 3D button 
 * with Sass + Bourbon
 *
 * Need standard CSS?
 *
 * Click the Eye icon at the top right
 * corner of the CSS panel in order to 
 * copy/paste the compiled CSS.
 *
 * Jay S.
 * www.jaysalvat.com
 */
            
          
!
999px
Loading ..................

Console