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

              
                <article class="post">
  <header class="post-header">
    <h1>Header Level 1</h1>
    <p>This is some meta data</p>
  </header>
  <section class="post-content">

    <p><strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em>      Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci,
      sagittis tempus lacus enim ac dui. <a href="#">Donec non enim</a> in turpis pulvinar facilisis. Ut felis.</p>

    <img src="http://fillmurray.com/1600/900" />


    <h2>Header Level 2</h2>

    <ol>
      <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
      <li>Aliquam tincidunt mauris eu risus.</li>
    </ol>

    <blockquote>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus
        turpis elit sit amet quam. Vivamus pretium ornare est.</p>
    </blockquote>

    <div class="fluid-width-video-wrapper">
      <iframe width="560" height="315" src="https://www.youtube.com/embed/8GsXbuR23WU?ecver=1" frameborder="0" allowfullscreen></iframe>
    </div>

    <h3>Header Level 3</h3>

    <ul>
      <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
      <li>Aliquam tincidunt mauris eu risus.</li>
    </ul>

    <pre><code>
#header h1 a {
  display: block;
  width: 300px;
  height: 80px;
}
</code></pre>

    <aside class="colored-bg-tier">
      <h2>What about tiers with colored backgrounds?</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores repellendus accusantium nostrum minima a ut perspiciatis ullam molestiae. Unde numquam, quisquam! Molestiae ipsa nesciunt reiciendis tempore voluptatum sequi sed sapiente?</p>
    </aside>

    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magnam, dolores laboriosam nihil corrupti veniam eveniet quaerat cupiditate dolore quam voluptatum facere magni odit ipsum iste qui accusamus. Harum, rerum, incidunt?</p>

  </section>
</article>
              
            
!

CSS

              
                /* Reset Stuff */
body {
  padding: 0;
  margin: 0;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

li {
  margin-left: 1.5em;
}

/* FitVids Stuff */
.fluid-width-video-wrapper {
  position: relative;
  height: 0;
  width: 100%;
  padding-top: 56.35%;
  iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* CSS Trick Begins Here */
.post-header,
.post-content > *:not(img):not(.fluid-width-video-wrapper):not(.colored-bg-tier),
.colored-bg-tier > * {
  padding-left: 5%;
  padding-right: 5%;
  max-width: 50rem;  /*REM not EM */
  margin-left: auto;
  margin-right: auto;
}

.post-content > img,
.post-content > .fluid-width-video-wrapper {
  width: 1600px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.colored-bg-tier {
  background: #f0f0f0;
  padding-top: 5%;
  padding-bottom: 5%;
}

/* Custom Post styles */
.post-content > blockquote {
  max-width: 47rem!important;
  /* This isn't good :( But I could move it to the exemption list if I want*/
  font-style: italic;
}

.post-header {
  border-bottom: 1px solid #ccc;
  h1 {
    margin-bottom: 0;
  }
  p {
    margin-top: 0;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console