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

              
                <figure class="d-container">
  <ul class="d-flex-order">
    <li>
      <a href="#">
        <h2>Headline</h2>
        <time datetime="2014-08-13">13th August</time>
        <p>A summary about some stuff</p>
      </a>
    </li>
    <li>
      <a href="#">
        <h2>Headline 2</h2>
        <time datetime="2014-07-10">10th July</time>
        <p>A summary about some stuff</p>
      </a>
    </li>
    <li class="d-flex-pinned">
      <a href="#">
        <h2>Headline 3</h2>
        <time datetime="2014-06-18">18th June</time>
        <p>This box will come first because it is pinned, even though in the DOM it actually comes third. I've also emulated how you might display a feature item, doubling its space to give priority to it.</p>
      </a>
    </li>
    <li>
      <a href="#">
        <h2>Headline 4</h2>
        <time datetime="2014-03-04">4th March</time>
        <p>A summary about some stuff</p>
      </a>
    </li>
    <li>
      <a href="#">
        <h2>Headline 5</h2>
        <time datetime="2014-02-16">16th February</time>
        <p>A summary about some stuff this time its much longer than before because flexbox</p>
      </a>
    </li>
    <li>
      <a href="#">
        <h2>Headline 6</h2>
        <time datetime="2014-01-30">30th January</time>
        <p>A summary about some stuff this time its much longer than before because flexbox</p>
      </a>
    </li>
    <li>
      <a href="#">
        <h2>Headline 7</h2>
        <time datetime="2014-01-15">15th January</time>
        <p>A summary about some stuff this time its much longer than before because flexbox</p>
      </a>
    </li>
  </ul>
</figure>
              
            
!

CSS

              
                * {
    margin: 0;
    padding: 0
}

li {
    list-style: none
}

* {
    box-sizing: border-box
}


body {
    font-size: 100%;
    line-height: 1.6
}

.d-container:first-child {
    margin-top: 0
}

.d-container {
    background: #f7f7f7;
    border-bottom: 1px solid #eee;
    margin: 2em auto;
    padding: 2em 5%;
    width: 100%
}

.d-container:after {
    clear: both;
    content: "";
    display: table
}

.d-container>h1 {
    color: #333;
    font-size: 2em;
    line-height: 1.2;
    margin: 0 0 .5em;
    text-align: center
}

.d-flex-order {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    max-width: 100%;
    margin: 0 auto;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: start;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    -webkit-box-align: stretch;
    -webkit-align-items: stretch;
    -ms-flex-align: stretch;
    align-items: stretch
}

.d-flex-order>li {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 100%;
    -ms-flex: 0 0 100%;
    flex: 0 0 100%;
    list-style: none
}

.d-flex-order>li a {
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    display: block;
    width: 100%;
    margin: 1em;
    padding: 1.5em;
    text-decoration: none;
    -webkit-transition: background .35s ease;
    transition: background .35s ease
}

.d-flex-order>li a:hover {
    background: #eee
}

.d-flex-order>li h2 {
    display: block;
    font-size: 2.2em;
    line-height: 1.3
}

.d-flex-order>li time {
    color: #666;
    display: block;
    margin: .5em 0 1em
}

.d-flex-order>li p {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex
}

.d-flex-order>li.d-flex-pinned {
    -webkit-box-ordinal-group: 0;
    -webkit-order: -1;
    -ms-flex-order: -1;
    order: -1;
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 100%;
    -ms-flex: 0 0 100%;
    flex: 0 0 100%
}
@media all and (min-width: 48em) {
    .d-container>h1 {
        font-size:3.5em
    }

    .d-flex-order>li {
        -webkit-box-flex: 0;
        -webkit-flex: 0 0 33%;
        -ms-flex: 0 0 33%;
        flex: 0 0 33%
    }

    .d-flex-order>li.d-flex-pinned {
        -webkit-box-flex: 0;
        -webkit-flex: 0 0 66%;
        -ms-flex: 0 0 66%;
        flex: 0 0 66%
    }
}

              
            
!

JS

              
                
              
            
!
999px

Console