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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <div id="content">
  <div class="content-inner">
  <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Sapiente ipsa quae necessitatibus molestiae quia laboriosam culpa sed? Neque ipsa possimus, natus quibusdam, dolorum quo commodi distinctio, deserunt ad dolorem suscipit.</p>
  <h2>Sapiente, porro debitis perspiciatis temporibus odit quia</h2>
  <p>Officia consequatur cumque quod voluptatum necessitatibus esse animi at. Maxime fugit eligendi ullam modi quod cum qui consectetur distinctio cumque natus reiciendis nihil praesentium fugiat, itaque iusto temporibus quo explicabo.</p>
  <p>Tempora quisquam facilis placeat enim cum quaerat esse provident, error saepe nisi voluptates tenetur! Explicabo, asperiores! Maxime, suscipit adipisci, blanditiis repellendus quaerat facere ab consequuntur a quis, accusamus architecto voluptatum.</p>
  <h3>Amet consectetur adipisicing</h3>
  <p>Commodi quas qui pariatur quidem hic facilis adipisci possimus consequuntur architecto! Ab consequuntur magni earum necessitatibus atque laborum ea modi deserunt excepturi aliquam, velit odit quas ad reiciendis cupiditate eligendi.</p>
  <p>Nulla, eos cupiditate. Illo magnam ratione mollitia. Rem facilis ex fuga repellat tenetur dolore mollitia culpa dolorum unde omnis magni consequuntur, eaque voluptatem ipsum delectus tempora? Rem voluptas expedita sequi.</p>
  </div>
</div>
              
            
!

CSS

              
                body {
  font: 1em/1.618 sans-serif;
  padding: 1.5em;
  background-color: #eee;
}

h1, h2, h3 {
  font-family: serif;
  line-height: 1.25;
  margin: 1.5em 0 1rem;
}

#content {
  background-color: #fff;
  max-width: 65ch;
  margin: 0 auto;
  border-radius: 1em;
  overflow: hidden;
  box-shadow: 0 0 1em 0 rgba(black, .1);
}

.content-inner {
  padding: 1.25em 2em;
}

.has-headings {
  &:before {
    display: block;
    padding: 1.25em 2em;
    font-weight: bold;
    background-color: #fcf;
    content: "This text contains headings."
  }
}
              
            
!

JS

              
                let content = document.querySelector("#content"),
  contentHeadings = []

if (content) {
  contentHeadings = content.querySelectorAll("h1, h2, h3")
}

if (contentHeadings.length) {
  content.classList.add("has-headings")
}

              
            
!
999px

Console