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

              
                <a href="#" class="btn btn-primary">Primary</a>
<a href="#" class="btn btn-accent">Accent</a>
<a href="#" class="btn btn-success">Success</a>
<br><br>

<a href="#" class="btn btn-primary btn-raised">Primary</a>
<a href="#" class="btn btn-accent btn-raised">Accent</a>
<a href="#" class="btn btn-success btn-raised">Success</a>
<br><br>

<a href="#" class="btn btn-flat primary">Success</a>
<a href="#" class="btn btn-flat accent">Success</a>
<a href="#" class="btn btn-flat success">Success</a>
<br><br>

<a href="#" class="btn btn-accent btn-action btn-raised">
    <i class="material-icons">add</i>
</a>
<a href="#" class="btn btn-accent btn-action-lg btn-raised">
    <i class="material-icons">add</i>
</a>

              
            
!

CSS

              
                /* ----- IMPORT ROBOTO FONT ----- */
@import url(https://fonts.googleapis.com/css?family=Roboto:400,300,500,700,100);
@import url(https://fonts.googleapis.com/icon?family=Material+Icons);

body {
	font-family: 'Roboto', sans-serif;
	background-color: #f5f5f5;
}

/* ******************************
RIPPLES EFFECT
****************************** */
    .ripples {
        overflow: hidden;
        position: relative;
    }
    
    .waves {
        position: absolute;
        display: block;
        border-radius: 100%;
        background-color: rgba(255, 255, 255, 0.3);
        -webkit-transform: scale(0);
           -moz-transform: scale(0);
             -o-transform: scale(0);
                transform: scale(0);
    }

    .ripple {
        -webkit-animation: ripple 0.65s linear;
           -moz-animation: ripple 0.65s linear;
            -ms-animation: ripple 0.65s linear;
             -o-animation: ripple 0.65s linear;
                animation: ripple 0.65s linear;
    }

    @-webkit-keyframes ripple {
        100% {
            opacity: 0;
            -webkit-transform: scale(2.5);
        }
    }
    
    @-moz-keyframes ripple {
        100% {
            opacity: 0;
            -moz-transform: scale(2.5);
        }
    }
    
    @-o-keyframes ripple {
        100% {
            opacity: 0;
            -o-transform: scale(2.5);
        }
    }
    
    @keyframes ripple {
        100% {
            opacity: 0;
            transform: scale(2.5);
        }
    }

/* ******************************
BUTTONS
****************************** */
.btn {
    overflow: hidden;
    cursor: pointer;
    position: relative;
    z-index: 10;
    display: inline-block;
    height: 36px;
    line-height: 36px;
    vertical-align: middle;
    border: none;
    padding: 0 16px;
    white-space: nowrap;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    font-weight: 400;
    font-size: 14px;
    color: #212121;
    background-image: none;
    background-color: #E0E0E0;
    
    -webkit-border-radius: 2px;
       -moz-border-radius: 2px;
            border-radius: 2px;

    -webkit-box-shadow: none;
       -moz-box-shadow: none;
            box-shadow: none;

    -webkit-transition: all 0.2s ease;
       -moz-transition: all 0.2s ease;
         -o-transition: all 0.2s ease;
            transition: all 0.2s ease;

    -ms-touch-action: manipulation;
        touch-action: manipulation;

    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;

    -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
}

/* ----- BUTTON STATES ----- */
    .btn:focus,
    .btn:active:focus,
    .btn.active:focus,
    .btn.focus,
    .btn:active.focus,
    .btn.active.focus {
        outline: none;
    }

    .btn:hover,
    .btn:focus,
    .btn.focus {
        color: #212121;
        text-decoration: none;
    }

    .btn:active,
    .btn.active {
        outline: 0;
        background-image: none;
    }

    .btn.disabled,
    .btn[disabled],
    fieldset[disabled] .btn {
        cursor: not-allowed;
        pointer-events: none;
        opacity: 0.5;
        filter: alpha(opacity=50);
    }

/* ----- ALTERNATE OPTIONS ----- */
/* PRIMARY */
    .btn-primary {
        color: #ffffff;
        background-color: #3F51B5;
    }

    .btn-primary:hover,
    .btn-primary:focus,
    .btn-primary.focus,
    .btn-primary:active,
    .btn-primary.active {
        color: #ffffff;
        background-color: #3949AB;
    }

/* ACCENT */
    .btn-accent {
        color: #ffffff;
        background-color: #EC407A;
    }

    .btn-accent:hover,
    .btn-accent:focus,
    .btn-accent.focus,
    .btn-accent:active,
    .btn-accent.active {
        color: #ffffff;
        background-color: #E91E63;
    }

/* SUCCESS */
    .btn-success {
        color: #ffffff;
        background-color: #009688;
    }

    .btn-success:hover,
    .btn-success:focus,
    .btn-success.focus,
    .btn-success:active,
    .btn-success.active {
        color: #ffffff;
        background-color: #00897B;
    }

/* ----- RAISED ----- */
    .btn-raised {
        -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16), 0 2px 5px rgba(0, 0, 0, 0.26);
           -moz-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16), 0 2px 5px rgba(0, 0, 0, 0.26);
                box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16), 0 2px 5px rgba(0, 0, 0, 0.26);
    }

/* ----- FLAT BUTTONS ----- */
    .btn-flat {
        font-weight: 400;
        color: #212121;
        background-color: transparent;
    }

    .btn-flat .waves {
        background-color: rgba(33, 33, 33, 0.1);
    }

    .btn-flat:hover,
    .btn-flat:focus,
    .btn-flat.focus,
    .btn-flat:active,
    .btn-flat.active {
        color: #212121;
    }

/* FLAT PRIMARY */
    .btn-flat.primary {
        color: #3F51B5;
    }

    .btn-flat.primary .waves {
        background-color: rgba(63, 81, 181, 0.3);
    }

/* FLAT ACCENT */
    .btn-flat.accent {
        color: #EC407A;
    }

    .btn-flat.accent .waves {
        background-color: rgba(255, 64, 129, 0.3);
    }

/* FLAT SUCCESS */
    .btn-flat.success {
        color: #009688;
    }

    .btn-flat.success .waves {
        background-color: rgba(0, 150, 136, 0.3);
    }

/* ----- ACTION ----- */
    .btn-action {
        min-width: 40px;
        width: 40px;
        height: 40px;
        line-height: 55px;
        padding: 0;
        border-radius: 20px;
    }

    .btn-action-lg {
        min-width: 56px;
        width: 56px;
        height: 56px;
        line-height: 84px;
        padding: 0;
        border-radius: 28px;
    }

    .btn-action-lg .material-icons {
        font-size: 36px;
    }

    .btn-action .waves,
    .btn-action-lg .waves {
        display: none;
    }
              
            
!

JS

              
                "use strict";

// RIPPLES EFFECT
function ripplesEffect(e) {
    var waves, d, x, y;
    
    if($(this).find('.waves').length === 0) {
        $(this).prepend('<span class="waves"></span>');
    }
     
    waves = $(this).find('.waves');
    waves.removeClass('ripple');
     
    if(!waves.height() && !waves.width()) {
        d = Math.max($(this).outerWidth(), $(this).outerHeight());
        waves.css({height: d, width: d});
    }
    
    x = e.pageX - $(this).offset().left - waves.width()/2;
    y = e.pageY - $(this).offset().top - waves.height()/2;
     
    waves.css({top: y+'px', left: x+'px'}).addClass('ripple');
};

$(document).ready(function(){
    $('.btn, .ripples').on('click', ripplesEffect);
});
              
            
!
999px

Console