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

              
                <body>
  <header>
    My Website
  </header>
  <main>
    <article>
      <h1>My web page</h1>
      <p>This is my web page. There are many like it but this one is mine.</p>
      <p>I’m using the HyperText Markup Language (<dfn>HTML</dfn>) to give structure to this page.</p>
      <p>For example, this text is inside a paragraph which is inside an article which is inside the main content.</p>
      <p>For the tangential information that follows, I’m using the <code>aside</code> element.</p>
    </article>
    <aside>
      <h2>History</h2>
      <p>Did you know that <a href="http://info.cern.ch/hypertext/WWW/TheProject.html">the first web page ever made</a> is still online at its original URL?</p>
      <p>The page was created by Tim Berners-Lee in the early 90s and it still works in a modern web browser.</p>
    </aside>
  </main>
  <footer>
    <small>I made this!</small>
  </footer>
</body>
              
            
!

CSS

              
                body {
  margin: 0;
  padding: 0;
}

p {
  margin-block-start: var(--metric-box-spacing);
}

header,
footer {
  text-align: center;
}

header {
  padding: var(--metric-box-spacing);
  background-color: hsl(140deg 70% 95%);
  font-size: 1.4em;
}

main {
  min-block-size: calc(100vh - 6em);
}

article {
  background-color: hsl(60deg 70% 95%);
}

aside {
  background-color: hsl(0deg 70% 95%);
}

article,
aside {
  padding: var(--metric-box-spacing);
  margin: var(--metric-box-spacing);
}

footer {
  padding: calc(var(--metric-box-spacing) / 2);
  background-color: hsl(200deg 70% 95%);
}

@media (min-width: 45em) {
  main {
    display: grid;
    grid-template-columns: 2fr 1fr;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console