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

              
                <form class="grid">
  <h1>Secure Checkout</h1>
  <div class="warning card">Warning stuff</div>
  <fieldset class="card">
    <h3>Your details</h3>
    <label for="name">First Name</label>
    <input type="text" id="name" />
  </fieldset>
  <fieldset class="card">
    <h3>Other stuff</h3>
    <label for="thing">Thing</label>
    <input type="text" id="thing" />
  </fieldset>
  <div class="sidebar">
    <div class="card">
      <h3>The sidebar</h3>
      <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Architecto, nulla.</p>
      <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum, fuga. Consectetur pariatur quidem veniam illum cum. Expedita voluptate quibusdam sed nobis, ut quod ipsum nostrum ducimus dolores commodi et sequi recusandae ad, accusamus minus, perspiciatis corrupti modi reiciendis suscipit. Et qui, fugit iusto consequuntur repellat nihil saepe quos exercitationem ducimus dolorem, laudantium porro odit. Tempore, natus totam praesentium rem excepturi reiciendis soluta ipsa minus deserunt nostrum voluptas, sequi voluptates cupiditate dolores laudantium officia, atque repellat suscipit saepe voluptatibus molestias maiores non! Voluptatem cupiditate totam deleniti dicta doloribus quibusdam. Laudantium aperiam explicabo assumenda eius voluptate quia fugiat possimus eum cupiditate eaque!</p>
    </div>
  </div>
  <button type="submit">Submit</button>
</form>
              
            
!

CSS

              
                .grid {
  margin: 2rem auto;
  height: 100%;
  & > * + * {
    margin-top: 1rem;
  }
  @media(min-width: 40em) {
    max-width: 60rem;
    margin: 4rem auto;
    display: grid;
    align-content: start;
    grid-template-columns: 1fr 20rem;
    column-gap: 2rem;
    & > * {
      grid-column: 1;
    }
  }
}

.card {
  padding: 1rem;
  border: 1px solid grey;
}

.sidebar {
  @media(min-width: 40em) {
    margin-top: 0;
    grid-column: 2;
    grid-row: 1 / 100;
    position: sticky;
    top: 1rem;
  }
}

.warning {
  background-color: skyblue;
}

* {
  margin: 0;
  box-sizing: border-box;
}

body {
  height: 150vh;
}

h1 {
  margin: 0;
}

button {
  display: block;
  width: 100%;
  background: none;
  border: 1px solid;
  font-family: inherit;
  font-size: inherit;
  padding: 0.5rem;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
              
            
!

JS

              
                
              
            
!
999px

Console