Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>button</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
        integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.1/css/font-awesome.min.css">
</head>
<body>
    <h1>Animated Buttons</h1>
    <p>Hover us and enjoy the satisfying animations!!</p>
    <div class="showcase">
        <div>
            <button class="custom-btn btn-1">Hover Me</button>
            <button class="custom-btn btn-2">Hover Me</button>
            <button class="custom-btn btn-3">Hover Me</button>
            <button class="custom-btn btn-4">Hover Me</button>
        </div>
        <div>
            <button class="custom-btn btn-5">Hover Me</button>
            <button class="custom-btn btn-6">Hover Me</button>
            <button class="custom-btn btn-7">Hover Me</button>
            <button class="custom-btn btn-8"><span>Hey!!</span><span>Hover Me</span></button>
        </div>
    </div>
</body>

</html>
              
            
!

CSS

              
                 body {
            margin-top: 100px;
            text-align: center;
            background: #e0e5ec !important;
        }

        h1 {
            color: #353535;
            font-weight: 700;
            font-size: 45px;
        }

        p {
            font-size: 18px;
        }

        .showcase {
            width: 90%;
            margin: 40px auto;
        }

        button {
            margin: 20px;
        }

        .custom-btn {
            width: 130px;
            height: 40px;
            color: #fff;
            border-radius: 5px;
            font-size: 18px;
            font-weight: 500;
            background: transparent;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            display: inline-block;
            box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, .5), 7px 7px 20px 0px rgba(0, 0, 0, .1), 4px 4px 5px 0px rgba(0, 0, 0, .1);
            outline: none;
            border: none;
            letter-spacing: 0.5px;
            text-transform: capitalize;
          margin-right:40px;
          margin-bottom:40px;
        }

        /* button-1 */
        .btn-1 {
            background: linear-gradient(0deg, rgba(255, 151, 0, 1) 0%, rgba(251, 75, 2, 1) 100%);
            border: none;
        }

        .btn-1:before {
            height: 0%;
            width: 2px;
        }

        .btn-1:hover {
            box-shadow: 4px 4px 6px 0 rgba(255, 255, 255, .5),
                -4px -4px 6px 0 rgba(116, 125, 136, .5),
                inset -4px -4px 6px 0 rgba(255, 255, 255, .2),
                inset 4px 4px 6px 0 rgba(0, 0, 0, .4);
        }

        /* button-2 */
        .btn-2 {
            color: #fff;
            background-color: #555;
            padding: 7px 20px 6px;
            border: none;
            border-radius: 40px;
            transition: all 0.3s ease 0s;
        }

        .btn-2:focus {
            color: #fff;
        }

        .btn-2:hover {
            color: #ff3571;
            background: #fff;
            box-shadow: 4px 2px #ee5253, 7px -2px #10ac84, 9px 3px #ff9f43, -5px -3px #ff3571, -7px 3px #5f27cd;
        }

        /* button-3 */
        .btn-3 {
            width: 130px;
            height: 40px;
            line-height: 42px;
            padding: 0;
            border: none;
            background: linear-gradient(0deg, rgba(96, 9, 240, 1) 0%, rgba(129, 5, 240, 1) 100%);
        }

        .btn-3:hover {
            color: rgba(96, 9, 240, 1);
            background: transparent;
            box-shadow: none;
        }

        .btn-3:before,
        .btn-3:after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            height: 2px;
            width: 0;
            background: rgba(96, 9, 240, 1);
            box-shadow:
                -1px -1px 5px 0px #fff,
                7px 7px 20px 0px #0003,
                4px 4px 5px 0px #0002;
            transition: 400ms ease all;
        }

        .btn-3:after {
            right: inherit;
            top: inherit;
            left: 0;
            bottom: 0;
        }

        .btn-3:hover:before,
        .btn-3:hover:after {
            width: 100%;
            transition: 800ms ease all;
        }

        /* button-4 */
        .btn-4 {
            color: #fff;
            background-color: #0a9396;
            border-radius: 0;
            position: relative;
            z-index: 1;
            transition: all 0.3s ease 0s;
        }

        .btn-4:hover {
            margin-left: 10px;
            margin-top: 10px;
            color: #fff;
        }

        .btn-4:before,
        .btn-4:after {
            content: '';
            background-color: #005f73;
            height: 7px;
            width: 100%;
            transform: skewX(45deg);
            position: absolute;
            right: -3.5px;
            bottom: -7px;
            z-index: -1;
            transition: all 0.3s ease 0s;
        }

        .btn-4:after {
            background-color: #005f73;
            height: 100%;
            width: 7px;
            transform: skewY(45deg);
            right: -7px;
            bottom: -3.5px;
        }

        .btn-4:hover:before {
            height: 3px;
            right: -1.5px;
            bottom: -3px;
        }

        .btn-4:hover:after {
            width: 3px;
            bottom: -1.5px;
            right: -3px;
        }

        /* button-5 */
        .btn-5 {
            color: #111;
            background-color: #e1e1e1;
            border: none;
            border-radius: 20px;
            overflow: hidden;
            position: relative;
            z-index: 1;
            transition: all 0.3s ease 0s;
        }

        .btn-5:focus,
        .btn-5:hover {
            color: #fff;
            background-color: transparent;
            box-shadow: none;
        }

        .btn-5:before {
            content: '';
            background-color: #D31122;
            height: 40px;
            width: 40px;
            border-radius: 50%;
            box-shadow: 17px 0 #BD1728, 34px 0 #AA1621, 51px 0 #90111C, -17px 0 #BD1728, -34px 0 #AA1621, -51px 0 #90111C;
            opacity: 0;
            transform: translateX(-50%) scale(0);
            position: absolute;
            left: 50%;
            top: 0;
            z-index: -1;
            transition: all 0.5s ease 0s;
        }

        .btn-5:focus:before,
        .btn-5:hover:before {
            opacity: 1;
            transform: translateX(-50%) scale(1);
        }

        /* button-6 */
        .btn-6 {
            border: none;
            /* color: #000; */
            background: linear-gradient(0deg, rgba(251, 33, 117, 1) 0%, rgba(234, 76, 137, 1) 100%);
        }

        .btn-6:after {
            position: absolute;
            content: "";
            width: 0;
            height: 100%;
            top: 0;
            left: 0;
            direction: rtl;
            z-index: -1;
            box-shadow:
                -7px -7px 20px 0px #fff9,
                -4px -4px 5px 0px #fff9,
                7px 7px 20px 0px #0002,
                4px 4px 5px 0px #0001;
            transition: all 0.3s ease;
        }

        .btn-6:hover {
            color: #000;
        }

        .btn-6:hover:after {
            left: auto;
            right: 0;
            width: 100%;
        }

        .btn-6:active {
            top: 2px;
        }

        /* button-7 */
        .btn-7 {
            background: #b76935;
            border: none;
            z-index: 1;
        }

        .btn-7:after {
            position: absolute;
            content: "";
            width: 0;
            height: 100%;
            top: 0;
            right: 0;
            z-index: -1;
            background-color: #935e38;
            border-radius: 5px;
            box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, .5),
                7px 7px 20px 0px rgba(0, 0, 0, .1),
                4px 4px 5px 0px rgba(0, 0, 0, .1);
            transition: all 0.3s ease;
        }

        .btn-7:hover {
            color: #fff;
        }

        .btn-7:hover:after {
            left: 0;
            width: 100%;
        }

        .btn-7:active {
            top: 2px;
        }

        /* button-8 */
        .btn-8 {
            position: relative;
            right: 20px;
            bottom: 20px;
            border: none;
            box-shadow: none;
            width: 130px;
            height: 40px;
            line-height: 42px;
            -webkit-perspective: 230px;
            perspective: 230px;
        }

        .btn-8 span {
            background: rgb(0, 172, 238);
            background: linear-gradient(0deg, rgba(0, 172, 238, 1) 0%, rgba(2, 126, 251, 1) 100%);
            display: block;
            position: absolute;
            width: 130px;
            height: 40px;
            box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, .5),
                7px 7px 20px 0px rgba(0, 0, 0, .1),
                4px 4px 5px 0px rgba(0, 0, 0, .1);
            border-radius: 5px;
            margin: 0;
            text-align: center;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            -webkit-transition: all .3s;
            transition: all .3s;
        }

        .btn-8 span:nth-child(1) {
            box-shadow:
                -7px -7px 20px 0px #fff9,
                -4px -4px 5px 0px #fff9,
                7px 7px 20px 0px #0002,
                4px 4px 5px 0px #0001;
            -webkit-transform: rotateX(90deg);
            -moz-transform: rotateX(90deg);
            transform: rotateX(90deg);
            -webkit-transform-origin: 50% 50% -20px;
            -moz-transform-origin: 50% 50% -20px;
            transform-origin: 50% 50% -20px;
        }

        .btn-8 span:nth-child(2) {
            -webkit-transform: rotateX(0deg);
            -moz-transform: rotateX(0deg);
            transform: rotateX(0deg);
            -webkit-transform-origin: 50% 50% -20px;
            -moz-transform-origin: 50% 50% -20px;
            transform-origin: 50% 50% -20px;
        }

        .btn-8:hover span:nth-child(1) {
            box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, .5),
                7px 7px 20px 0px rgba(0, 0, 0, .1),
                4px 4px 5px 0px rgba(0, 0, 0, .1);
            -webkit-transform: rotateX(0deg);
            -moz-transform: rotateX(0deg);
            transform: rotateX(0deg);
        }

        .btn-8:hover span:nth-child(2) {
            box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, .5),
                7px 7px 20px 0px rgba(0, 0, 0, .1),
                4px 4px 5px 0px rgba(0, 0, 0, .1);
            color: transparent;
            -webkit-transform: rotateX(-90deg);
            -moz-transform: rotateX(-90deg);
            transform: rotateX(-90deg);
        }
              
            
!

JS

              
                
              
            
!
999px

Console