octocatstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource
via CSS Lint

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource
via JS Hint

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Want a Run Button?

If active, the preview will update automatically when you change code.

HTML

            
              <a href="#" class="button">CLICK</a>
            
          
!

CSS

            
              @import "compass/css3";

$font_size: 22px;
$width: 124px;
$height: 44px;
$bg: #CC4331;
$bg_hover: lighten($bg, 5%);
$txt_color: white;
$bg_shadow: rgba(0,0,0,0.4);

@mixin middle($width, $height) {
  position: absolute;
  top: 50%;
  left: 50%;
  width: $width;
  height: $height;
  margin-top: (-$height)/2;
  margin-left: (-$width)/2; 
}

html {
  width: 100%;
  height: 100%;
}

body {
  @extend html;
  font-family: sans-serif;
  background-image: url(http://subtlepatterns.subtlepatterns.netdna-cdn.com/patterns/retina_wood.png);
}

.button {
  display: block;
  font-size: $font_size;
  text-align: center;
  line-height: $height;
  text-decoration: none;
  color: $txt_color;
  background-color: $bg;
  border-radius: 4px;
  @include middle($width, $height);
  @include text-shadow(0 -1px -1px darken($bg, 7%));
  @include box-shadow(
    0 4px 0 darken($bg, 7%),
    0 5px 5px 1px $bg_shadow);
  @include transition(all .15s ease-in-out);
  
  &:hover{
    background-color: $bg_hover;
    @include text-shadow(0 -1px -1px darken($bg_hover, 7%));
    @include box-shadow(
      0 4px 0 darken($bg_hover, 7%),
      0 5px 5px 1px $bg_shadow);
  }
  &:active {
    margin-top: (-$height)/2 + 4;
    @include box-shadow(none);
  }
}
            
          
!

JS

            
              /*
/ What?: CSS3 Button in SCSS
/ Who?: Karol "Nosenation" Falkiewicz
/ Email: nosenation@gmail.com
/
/
/ PS: Check this colors: #12A65C, #08A6A6
*/
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console