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

              
                <main class="cards">
  <section class="card">
    <h2>Lorem Egestas Tristique Ligula</h2>
    <p>Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum. Nullam quis risus eget urna mollis ornare vel eu leo.</p>
  </section>
  <section class="card">
    <h2>Cras Fermentum Bibendum Dolor</h2>
    <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nullam quis risus eget urna mollis ornare vel eu leo.</p>
  </section>
  <section class="card">
    <h2>Pharetra Mattis Tristique Mollis Quam</h2>
    <p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
  </section>
  <section class="card">
    <h2>Nullam Aenean</h2>
    <p>Vestibulum id ligula porta felis euismod semper. Nullam quis risus eget urna mollis ornare vel eu leo.</p>
  </section>
  <section class="card">
    <h2>Porta Venenatis Sollicitudin Pharetra</h2>
    <p>Nullam quis risus eget urna mollis ornare vel eu leo. Sed posuere consectetur est at lobortis.</p>
  </section>
  <section class="card">
    <h2>Fermentum Lorem Parturient Dapibus</h2>
    <p>Donec ullamcorper nulla non metus auctor fringilla. Aenean lacinia bibendum nulla sed consectetur.</p>
  </section>
</main>
              
            
!

CSS

              
                :root {
  /* Sizes that the rest of our system will be based on */
  --ft-screen-width: 1440;
  --ft-body: 20;
  --ft-body-min: 0.75rem; /* Going this small for demo purposes */
  --ft-body-max: 2rem;
  --ft-body-vw: calc(var(--ft-body) / var(--ft-screen-width) * 100vw);
  
  /* Body, 20px on 1440px screens */
  --ft-size-body: clamp(var(--ft-body-min), var(--ft-body-vw), var(--ft-body-max));

  /* Heading, 26px on 1440px screens */
  --ft-heading: 26;
  --ft-size-heading: clamp(var(--ft-body-min) * (var(--ft-heading) / var(--ft-body)), var(--ft-body-vw) * (var(--ft-heading) / var(--ft-body)), var(--ft-body-max) * (var(--ft-heading) / var(--ft-body)));
}

body {
  --space-1rem: 1em;
  font-family: Georgia, serif;
  font-size: var(--ft-size-body);
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  padding: 1em;
  text-transform: none;
  word-spacing: normal;
}

h2 {
  --space-1rem: 0.77em;
  font-family: sans-serif;
  font-size: var(--ft-size-heading);
  font-style: normal;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: calc(var(--space-1rem) - 0.25em);
  margin-top: 0;
  text-transform: uppercase;
  word-spacing: 0.15em;
}

p {
  margin-bottom: var(--space-1rem);
  margin-top: 0;
}

p:last-child {
  margin-bottom: 0;
}

.cards {
  column-gap: 1em;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 1em;
}

.card {
  border: 1px solid black;
  padding: 1em;
}
              
            
!

JS

              
                
              
            
!
999px

Console