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

              
                <div class="content-container">
  
  <h1 class="title">Gradient buttons</h1>
  <p>The gradients are taken from <a href="https://uigradients.com" target="_blank" > https://uigradients.com</a></p>
  <div class="button-container">
    <button class="btn btn-default">Sample Button</button>
    <button class="btn btn-default">Sample Button</button>
    <button class="btn btn-default">Sample Button</button>
    <button class="btn btn-default">Sample Button</button>
  </div>
  
  
</div>
              
            
!

CSS

              
                .content-container
  margin-top: 5vh
  width: 100vw
  background-color: #fff
  display: flex
  justify-content: center
  align-items: center
  flex-direction: column

p, .title
  padding-bottom: 10px
  font-family: 'Dosis', sans-serif
  
.title
  text-transform: uppercase
  font-family: 'Source Sans Pro', sans-serif
  
.button-container
  width: 70%
  background: #F5F7F8
  padding: 3% 10% 7% 10%
  display: flex
  flex-direction: column
  justify-content: center
  align-items: center
  
  button
    text-transform: uppercase
    margin: 2vh 0vw
    width: 70%
    color: #fff
    font-size: 1.5rem
    padding-top: 1.75rem
    padding-bottom: 1.25rem
    border-radius: 10px
    box-shadow: 0 3px 3px 0 rgba(0,0,0,0.25)
    border: none
    cursor: pointer
    
    
    &:first-child
      font-family: 'Dosis', sans-serif
      background: linear-gradient(270deg, rgb(255, 78, 80), rgb(249, 212, 35))
      transition: font-size 0.25s
      &:hover
        font-size: 2rem
    
    &:nth-child(2)
      font-family: 'Fjalla One', sans-serif
      background: linear-gradient(270deg, rgb(229, 93, 135), rgb(95, 195, 228))
      background-size: 200% 200%
      animation: changeBg 2s ease infinite
      &:hover
        animation: changeBg 0.5s ease infinite

    &:nth-child(3)
      font-family: 'Lato', sans-serif
      background: linear-gradient(270deg, rgb(103, 178, 111), rgb(76, 162, 205))
      background-size: 200% 200%
      animation: changeBg 5s ease infinite
      &:hover
        animation: changeBg 0.25s ease infinite

    &:nth-child(4)
      font-family: 'Source Sans Pro', sans-serif
      background: linear-gradient(270deg, rgb(178, 69, 146), rgb(241, 95, 121))
      transition: font-size 0.25s
      &:hover
        font-size: 2rem
    
        
@keyframes changeBg
  0%
    background-position: 0% 50%
  50%
    background-position: 100% 50%
  100%
    background-position: 0% 50%

@-webkit-keyframes changeBg
  0%
    background-position: 0% 50%
  50%
    background-position: 100% 50%
  100%
    background-position: 0% 50%

@-moz-keyframes changeBg
  0%
    background-position: 0% 50%
  50%
    background-position: 100% 50%
  100%
    background-position: 0% 50%
              
            
!

JS

              
                
              
            
!
999px

Console