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="buttons-container">
  <div>
    <button class="content-button">Button on page 1</button>
  </div>
  <div>
    <button class="content-button">Button on page 2</button>
  </div>
  <div>
    <button class="content-button">Button on page 3</button>
  </div>
  <div>
    <button class="content-button">Button on page 4</button>
  </div>
  <div>
    <button class="content-button">Button on page 5</button>
  </div>
  <div>
    <button class="content-button">Button on page 6</button>
  </div>
  <div>
    <button class="content-button">Button on page 7</button>
  </div>
  <div>
    <button class="content-button">Button on page 8</button>
  </div>
  <div>
    <button class="content-button">Button on page 9</button>
  </div>
  <div>
    <button class="content-button">Button on page 10</button>
  </div>
  <div>
    <button class="content-button">Button on page 11</button>
  </div>
  <div>
    <button class="content-button">Button on page 12</button>
  </div>
  <div>
    <button class="content-button">Button on page 13</button>
  </div>
  <div>
    <button class="content-button">Button on page 14</button>
  </div>
  <div>
    <button class="content-button">Button on page 15</button>
  </div>
  <div>
    <button class="content-button">Button on page 16</button>
  </div>
  <div>
    <button class="content-button">Button on page 17</button>
  </div>
  <div>
    <button class="content-button">Button on page 18</button>
  </div>
</div>

<div class="fixed-footer">
  <button class="fixed-footer-button">Button in fixed footer</button>
</div>
              
            
!

CSS

              
                html,
body {
  // Make sure that there's space at the bottom of the page for the footer to not overlap with the last item
  margin: 0 0 50px 0;
  // Give an additional 10px wiggle room on the bottom scroll padding from the footer
  scroll-padding: 0 0 60px 0;
}

button {
  font-size: 16px;
  padding: 10px;
  margin: 5px;
  background: #eee;
  border: 1px solid gray;
  border-radius: 5px;
}

.fixed-footer {
  position: fixed;
  bottom: 0;
  height: 50px;
  width: 100%;
  border-top: 1px solid black;
  background: white;
  box-sizing: border-box;
}

              
            
!

JS

              
                $(".fixed-footer-button").click(() => {
  alert("Footer button clicked");
});

$(".content-button").click(() => {
  alert("Body button clicked");
});

              
            
!
999px

Console