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

              
                <button>I'm a button</button>
<p>(hover me, then click me)</p>
              
            
!

CSS

              
                body {
  align-items: center;
  background-color: #779fb8;
  display: flex;
  flex-direction: column;
  font-family: 'NB-Int-Regular', -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  height: 100vh;
  justify-content: center;
}

button {
  background-color: #000;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
  margin-bottom: 3rem;
  padding: .75rem 1.5rem;
  position: relative;
  text-transform: uppercase;
  transition: color .2s ease-out;
  z-index: 1;
}

button::before {
  background-color: #fff;
  background: linear-gradient(
    to bottom,
    #000 0%,
    #000 2.5%,
    #fff 2.5%,
    #fff 9%,
    #000 9%,
    #000 14%,
    #fff 14%,
    #fff 19.5%,
    #000 19.5%,
    #000 24.5%,
    #fff 24.5%,
    #fff 30%,
    #000 30%,
    #000 35%,
    #fff 35%,
    #fff 39%,
    #000 39%,
    #000 43%,
    #fff 43%,
    #fff 49%,
    #000 49%,
    #000 55%,
    #fff 55%,
    #fff 61%,
    #000 61%,
    #000 68%,
    #fff 68%,
    #fff 74%,
    #000 74%,
    #000 80%,
    #fff 80%,
    #fff 87%,
    #000 87%,
    #000 91%,
    #fff 91%,
    #fff 96%,
    #000 96%,
    #000 98%,
    #fff 98%,
    #fff 100%
   );
  border: 5px solid #000;
  content: '';
  height: 90%;
  left: -30px;
  position: absolute;
  top: 14px;
  transform: skewY(-45deg);
  width: 20px;
  z-index: -1;
}

button::after {
  background-color: #fff;
  background: linear-gradient(
    to right,
    #000 0%,
    #000 .5%,
    #fff .5%,
    #fff 1%,
    #000 1%,
    #000 1.5%,
    #fff 1.5%,
    #fff 2.5%,
    #000 2.5%,
    #000 3.5%,
    #fff 3.5%,
    #fff 4%,
    #000 4%,
    #000 4.5%,
    #fff 4.5%,
    #fff 5.5%,
    #000 5.5%,
    #000 6.5%,
    #fff 6.5%,
    #fff 7%,
    #000 7%,
    #000 7.5%,
    #fff 7.5%,
    #fff 8.5%,
    #000 8.5%,
    #000 9%,
    #fff 9%,
    #fff 10%,
    #000 10%,
    #000 11%,
    #fff 11%,
    #fff 11.5%,
    #000 11.5%,
    #000 12%,
    #fff 12%,
    #fff 14%,
    #000 14%,
    #000 15%,
    #fff 15%,
    #fff 16.5%,
    #000 16.5%,
    #000 17.5%,
    #fff 17.5%,
    #fff 18%,
    #000 18%,
    #000 19%,
    #fff 19%,
    #fff 21%,
    #000 21%,
    #000 22%,
    #fff 22%,
    #fff 23%,
    #000 23%,
    #000 23.5%,
    #fff 23.5%,
    #fff 24.5%,
    #000 24.5%,
    #000 25%,
    #fff 25%,
    #fff 27%,
    #000 27%,
    #000 27.5%,
    #fff 27.5%,
    #fff 28.5%,
    #000 28.5%,
    #000 29.5%,
    #fff 29.5%,
    #fff 31%,
    #000 31%,
    #000 31.5%,
    #fff 31.5%,
    #fff 32%,
    #000 32%,
    #000 33%,
    #fff 33%,
    #fff 35%,
    #000 35%,
    #000 35.5%,
    #fff 35.5%,
    #fff 37%,
    #000 37%,
    #000 38%,
    #fff 38%,
    #fff 40%,
    #000 40%,
    #000 41.5%,
    #fff 41.5%,
    #fff 42.5%,
    #000 42.5%,
    #000 43%,
    #fff 43%,
    #fff 44%,
    #000 44%,
    #000 46%,
    #fff 46%,
    #fff 47%,
    #000 47%,
    #000 48%,
    #fff 48%,
    #fff 50%,
    #000 50%,
    #000 50.5%,
    #fff 50.5%,
    #fff 52%,
    #000 52%,
    #000 53.5%,
    #fff 53.5%,
    #fff 54.5%,
    #000 54.5%,
    #000 56%,
    #fff 56%,
    #fff 58%,
    #000 58%,
    #000 60%,
    #fff 60%,
    #fff 63%,
    #000 63%,
    #000 64%,
    #fff 64%,
    #fff 67%,
    #000 67%,
    #000 67.5%,
    #fff 67.5%,
    #fff 68%,
    #000 68%,
    #000 69%,
    #fff 69%,
    #fff 71%,
    #000 71%,
    #000 73%,
    #fff 73%,
    #fff 74.5%,
    #000 74.5%,
    #000 76%,
    #fff 76%,
    #fff 77%,
    #000 77%,
    #000 79%,
    #fff 79%,
    #fff 81%,
    #000 81%,
    #000 81.5%,
    #fff 81.5%,
    #fff 83%,
    #000 83%,
    #000 83.5%,
    #fff 83.5%,
    #fff 85%,
    #000 85%,
    #000 86%,
    #fff 86%,
    #fff 88%,
    #000 88%,
    #000 89.5%,
    #fff 89.5%,
    #fff 91%,
    #000 91%,
    #000 92%,
    #fff 92%,
    #fff 94%,
    #000 94%,
    #000 95.5%,
    #fff 95.5%,
    #fff 97%,
    #000 97%,
    #000 97.5%,
    #fff 97.5%,
    #fff 99%,
    #000 99%,
    #000 100%
  );
  border: 5px solid #000;
  bottom: -32px;
  content: '';
  height: 23px;
  position: absolute;
  right: 16px;
  transform: skewX(-45deg);
  width: 95%;
  z-index: -1;
}

button:hover,
button:active {
  color: #f86638;
}

button:hover::before {
  animation: vertical 5s linear infinite;
}

button:hover::after {
  animation: horizontal 5s linear infinite;
}

button:active {
  left: -30px;
  top: 30px;
}

button:active::before {
  visibility: hidden;
}

button:active::after {
  visibility: hidden;
}

@keyframes vertical { 
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 -100px;
  }
}

@keyframes horizontal { 
  from {
    background-position: 0 0;
  }
  to {
    background-position: -100px 0;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console