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

              
                <html>
  <head>
  </head>
  <body>
    <header>
      <p>
        This document contains examples of how to
      use different <span id="subject">HTML elements</span>.
      </p>
        Table of Contents:
        <ol>
          <li>
            <a href="#headingsAndParagraphs">Headings and Paragraphs</a>
          </li>
          <li>
            <a href="#lists">Lists</a>
          </li>
          <li>
            <a href="#links">Links</a>
          </li>
        </ol>
    </header>
    <div id="headingsAndParagraphs">
      <h1>This is a level 1 heading!</h1>
      <p id="firstParagraph" class="paragraph first">
        This is a paragraph
      </p>
      <p id="secondParagraph" class="paragraph second">
        Inside this paragraph
        are words in <strong>Bold</strong>
        and others that have <em>emphasis</em>.
      </p>
    </div>
    <div id="lists">
      <ol>
        <li>The first item</li>
        <li>The second item.</li>
        <li>The third item.</li>
      </ol>
      <ul>
        <li>The first item</li>
        <li>The second item.</li>
        <li>The third item.</li>
      </ul>
    </div>
    <div id="links">
      <p>
        <a href="https://www.google.com/">Google</a>
      </p>
      <p>
        <a href="./page.html">A resource in the same directory</a>
      </p>
      <p>
        <a href="../page.html">A resource in one directory above</a>
      </p>
      <p>
        <a href="../../page.html">A resource in two directories above</a>
      </p>
    </div>
    <script>

    function Student(name, id) {
      this.name = name;
      this.id = id;
    }

    var student1 = new Student("Javier", 1234);
    var student2 = new Student("Matt", 5678);

    var studentObject = {
      student1,
      student2
    };

    var student;

    for(student in studentObject) {
      console.log(studentObject[student].name);
    }

    </script>
  </body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console