Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

                <div class="post-inner">
    <h2 class="post"><a href="#">Post title</a></h2>

    <div class="figure left">
      <img src=
      "data:image/gif;base64,R0lGODlhAQABAPAAAN3d3f///yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" />

      <div class="title">
        A sample image to go along with the post

    <div class="meta">
      <span class="comments"><a href="#">Post Comment</a></span> | <span class=
      "tags">Tags: <a href="#">example</a>, <a href="#">rem unit</a>, <a href=
<p class="instructions">Adjust size of secondary elements to be <a href="#secondary-12px">small</a>, <a href="#secondary-14px">medium</a> or <a href="#secondary-16px">large</a></p>
    <p>This page contains a variety of interface elements. They are not intended to actually work, and instead are here to show how a subset of elements with dimensions specified in rem can change size when &lt;html&gt; element font size is adjusted. Meanwhile, all other content remains unaffected.</p>
    <p>Since this is a technical demo, things will not look pretty, and that's OK.</p>
  <div class="meta">
    <span class="date">14 Mar 2013</span> | <span class="author">By Joe Author</span>

    <div class="slideshow">
      <div class="controls">
        <a class="previous" href="#">Previous</a> <a class="next" href="#">Next</a>
        <a class="page active" href="#">1</a> <a class="page" href="#">2</a> <a class=
        "page" href="#">3</a> <a class="page" href="#">4</a> <a class="page" href=
      <img src=
      "data:image/gif;base64,R0lGODlhAQABAPAAAKqq/////yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" />      
              html { font-size: 12px; }
html.secondary-12px { font-size: 12px; }
html.secondary-14px { font-size: 14px; }
html.secondary-16px { font-size: 16px; }

body { font-size: 18px; }
a { text-decoration: none; color: #669; }
.post-inner { font-family: sans-serif; }

.post-inner .meta { font-size: 1rem; }

.post-inner h2 { font-family: sans-serif; font-size: 32px; margin: 0.3em 0;}

.figure { width: 200px; padding: 10px; border: 1px solid #AAA; }
.figure img { width: 100%; }
.figure.left { float: left; margin-right: 10px; margin-bottom: 10px; }
.figure .title { font-size: 1rem; }

.slideshow { margin-bottom: 1em; overflow: hidden; clear: both;}
.slideshow img { width: 100%; height: 200px; }
.slideshow .controls { text-align: center; font-size: 1.25rem; }
.slideshow .previous { float: left; }
.slideshow .next { float: right; }

.slideshow .controls a { border: 1px solid #AAA; padding: 0 0.5rem; }
.slideshow .controls a.active { background: #EEE; }

.instructions { font-size: 1.2em; color: red; }
a[href^="#secondary"] {
  color: white; background: #C00; padding: 0 0.25em;
              document.addEventListener('DOMContentLoaded', function() { 
  [].forEach.call(document.querySelectorAll('a[href^="#secondary-"]'), function(el, i) {
    el.addEventListener('click', function(ev) {
      var docEl = document.documentElement,
          hash = this.getAttribute('href').slice(1);
      if (!hash) return;
      docEl.setAttribute("class", hash);
      docEl.style.display = "none";
      docEl.style.display = "";         
    }, false);
}, false); 
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.