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


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


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.


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.


                    <section class="box" data-behavior="sample_code">
        <a href="#" class="btn">Button</a>


                .box {
  font: 11px/15px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
  border-radius: 3px;
  margin: 0 0 10px;
  padding: 10px 0 0;
  border: 1px solid #888;
  & > * {
    margin-left: 10px;
    margin-right: 10px;
  & > header {
    padding: 13px 10px 11px 10px;
    margin: -10px 0 10px;
    border-bottom: 1px solid rgba(0,0,0,.2);
    background: #888;
    color: #fff;
  & > footer {
    margin: 0;
    color: #fff;
    background: #888;
    border-top: 1px solid rgba(0,0,0,.2);

    .btn {
      margin: 6px 0 6px 6px;
  h3 {
    margin: 0;
    font-size: 11px;
.btn {
  display: inline-block;
  padding: 0 20px;
  height: 24px;
  text-align: center;
  text-decoration: none;
  line-height: 24px;
  color: #fff;
  background: #333;
  border-radius: 12px;
code {
  display: block;
  white-space: pre-wrap;
  padding: 15px;
  background: #f2f2f2;
  border: 1px solid #e6e6e6;


  var container = $(this);
  var target ="code");
  //if we have a target
  if (target.length > 0) {
    // get the sample's html
    var sample_html = container[0].outerHTML;
    var white_space = "☺";
    // find how many spaces are before the part of the html
    try {
      white_space = sample_html.match(/\n+\s+\S/)[0].slice(0,(sample_html.match(/\n+\s+\S/)[0].length-3));
    } catch(err) {}
    // set up a regex to search for a white space string
    var re = new RegExp(white_space,"g");
    // replace white_space, < and > with &lt; and &gt; and remove the sample_code ref
    sample_html = sample_html.replace(re,"\n").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(' data-behavior="sample_code"','');
    // trim out any new lines at begining or end of string
    sample_html = $.trim(sample_html);
    // stick into target