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. 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

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

              
                <h1>Lorem ipsum dolor sit amet</h1>

<p><button type="button" onclick="toggleBodyClass();">Toggle <code>body</code> styles</button>
</p>

<p>
Consectetur adipiscing elit. Nulla sollicitudin suscipit velit, cursus accumsan nisi semper eu. Nam viverra orci eu risus euismod, maximus molestie mauris ullamcorper. Praesent venenatis convallis risus, a viverra arcu ullamcorper id. Vivamus semper posuere nisi quis pulvinar. Mauris malesuada tempus nulla eget pulvinar. Cras fermentum tincidunt orci elementum fringilla. Donec a libero a arcu pellentesque auctor. Duis cursus sit amet erat vel luctus. Curabitur neque est, laoreet lobortis mauris eu, venenatis egestas tortor. Fusce ut diam blandit, convallis turpis ultricies, imperdiet felis. In arcu metus, dignissim vitae velit at, sodales ullamcorper lorem. In hac habitasse platea dictumst. Morbi neque ex, bibendum eget lorem in, laoreet finibus mi.
</p>

<p>
Donec a est non lacus molestie dignissim. Etiam scelerisque rhoncus tempus. Donec consequat lectus velit, efficitur viverra nunc convallis non. Sed tincidunt nisi ac placerat scelerisque. Morbi id turpis et augue placerat tincidunt non eget risus. Vestibulum dictum dolor ullamcorper, consequat ligula facilisis, lobortis dolor. Nunc tincidunt nunc non justo accumsan pretium. Vestibulum placerat libero sem, quis blandit nisi fermentum sed.
</p>

<h2>Phasellus eu tortor tempor</h2>

<p>
Lacinia enim eu, sagittis magna. Proin lectus ipsum, efficitur eu ipsum non, ornare porta justo. Aenean nulla nunc, semper vitae risus non, blandit sodales tortor. In leo erat, pulvinar in dolor sit amet, vulputate aliquam urna. Mauris luctus dignissim erat id ullamcorper. Ut condimentum viverra nisl ac pellentesque. Donec id purus tincidunt, egestas sem sed, efficitur justo. Suspendisse malesuada eu libero vel posuere. Phasellus ut justo pulvinar, blandit ipsum vel, pretium nisl.
</p>

<p>
Nam consectetur dictum justo. Maecenas vitae magna eget nisl consequat dapibus sed eu felis. Etiam tristique maximus pulvinar. Donec laoreet condimentum nisl vitae elementum. Vivamus aliquam varius sem, vitae dapibus est mollis ac. Sed aliquet, justo nec mollis tristique, ligula tortor vulputate metus, nec consequat velit felis ac sapien. Sed scelerisque mattis ligula ac maximus. Donec rhoncus elit ut nisl ultricies tempus. Proin sollicitudin gravida velit sit amet mollis. Curabitur nunc leo, tempor sodales eros at, egestas ullamcorper felis. Donec dapibus turpis sapien, sit amet aliquam nunc fringilla vitae. Maecenas ante metus, aliquet suscipit tortor at, dictum dapibus turpis. Quisque finibus bibendum sollicitudin. Curabitur vitae felis ut felis laoreet tincidunt. Aenean euismod augue at auctor viverra. Nunc efficitur, nibh consectetur efficitur mattis, leo ipsum rhoncus nibh, eget elementum est sapien eget nunc.
</p>

<p>
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed finibus magna a sapien imperdiet euismod. Morbi risus mi, vulputate et ultricies et, facilisis ut tellus. Cras porta blandit ante, ac faucibus risus placerat ut. Proin volutpat, turpis eget scelerisque finibus, sem purus gravida orci, in pharetra lectus justo at mi. Curabitur euismod lectus nec quam posuere commodo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis ac fringilla turpis, at molestie mi. Nam bibendum lobortis lectus, ac hendrerit lorem pulvinar non. Curabitur sit amet lacinia lorem.
</p>

              
            
!

CSS

              
                body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.4;
}

body.styled {
  background-color: #eee;
/*   color: #333; */
}
              
            
!

JS

              
                function toggleBodyClass() {
  var theBody = document.querySelector("body");
  if (theBody.classList.contains("styled")) {
    theBody.classList.remove("styled");
  } else {
    theBody.classList.add("styled");
  }
}
              
            
!
999px

Console