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 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

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="button">
    <button class="btn-hover color">GRADIENT BUTTON</button>
</div>

              
            
!

CSS

              
                * {
  /*padding and border are included in the width and height of all elements */
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.button {
    margin: 10%;
  /* Centralize text */
    text-align: center;
}

.btn-hover.color {
  /* Button gradient color. The gradient have four different main colors, with a gradient between these. Only 2 of these colors will be visible on the button at any point. Upon hover, the background moves to show the other 2 colors  */
        background-image: linear-gradient(to right, #ed6ea0, #ec8c69, #f7186a , #FBB03B);
  /* Gives the button a shadow for a neon-like glow */
    box-shadow: 0 4px 15px 0 rgba(236, 116, 149, 0.75);
}

.btn-hover {
  /* Button size */
  height: 55px;
    width: 200px;
  /* Text size and boldness*/
    font-size: 14px;
    font-weight: 600;
  /* Text color */
    color: #fff;
  /* Cursor pointer */
    cursor: pointer;
  /* Margin around button */
    margin: 20px;
  /* Removes default border around buttons */
    border: none;
  /* This affects the gradient background size. By putting a background width to be 300% (above 100%), only the beginning portion of this background will be shown. When hovered, the background will shift towards the end, giving the illustion of a moving gradient*/
    background-size: 300% 100%;
/* Curves the button */
    border-radius: 50px;
  
  /* Transition duration and style */
    moz-transition: all .5s ease-in-out;
    -o-transition: all .5s ease-in-out;
    -webkit-transition: all .5s ease-in-out;
    transition: all .5s ease-in-out;
}

.btn-hover:hover {
  /* Changes the start position of the gradient background upon hover, giving the illusion of motion. Feel free to play around with this percentage value to see how it works */
    background-position: 100% 0;
  /* Duration of gradient transition */
    moz-transition: all .5s ease-in-out;
    -o-transition: all .5s ease-in-out;
    -webkit-transition: all .5s ease-in-out;
    transition: all .5s ease-in-out;
}


}




              
            
!

JS

              
                
              
            
!
999px

Console