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

              
                <ul class="grid">
  <li class="subgrid">
    <h2>Card header</h2>
    <span class="emoji" role="img" tabindex="0" aria-label="spouting whale">🐳</span>
    <p>Chocolate bar gummies powder bear claw cake dragée oat cake cake. </p>
    <span>Read more</span>
  </li>
  <li class="subgrid">
    <h2>Card header of different length</h2>
    <span class="emoji" role="img" tabindex="0" aria-label="owl">🦉</span>
    <p>Chupa chups marzipan ice cream croissant topping liquorice toffee chupa chups chocolate. Pie pie gummies sweet chocolate.</p>
    <span>Read more</span>
  </li>
  <li class="subgrid">
    <h2>Different card header</h2>
    <span class="emoji" role="img" tabindex="0" aria-label="monkey">🐒</span>
    <p>Cake icing toffee macaroon dragée pie powder chocolate cake. Croissant muffin tiramisu liquorice chocolate cake candy soufflé.</p>
    <span>Read more</span>
  </li>
  <li class="subgrid">
    <h2>Why cards?</h2>
    <span class="emoji" role="img" tabindex="0" aria-label="octopus">🐙</span>
    <p>Dragée bear claw chocolate cake jelly biscuit powder chupa chups oat cake.</p>
    <span>Read more</span>
  </li>
  <li class="subgrid">
    <h2>Caterpillar</h2>
    <span class="emoji" role="img" tabindex="0" aria-label="bug">🐛</span>
    <p>Fruitcake muffin pastry sesame snaps croissant gingerbread dessert cake liquorice. Sugar plum tiramisu pastry pudding.</p>
    <span>Read more</span>
  </li>
  <li class="subgrid">
    <h2>Crab</h2>
    <span class="emoji" role="img" tabindex="0" aria-label="crab">🦀</span>
    <p>Lemon drops dessert wafer bear claw chupa chups cotton candy. Oat cake chocolate dragée carrot cake cupcake tiramisu gingerbread jujubes danish.</p>
    <span>Read more</span>
  </li>
  <li class="subgrid">
    <h2>Chick</h2>
    <span class="emoji" role="img" tabindex="0" aria-label="front-facing baby chick">🐥</span>
    <p>Pie gingerbread chocolate cake chocolate chupa chups candy canes. Croissant sweet roll jelly.</p>
    <span>Read more</span>
  </li>
</ul>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, calc((100% - 3em) / 4));
  grid-template-rows: repeat(4, auto);
  gap: 1em;

  padding: 1em;
}

.subgrid {
  grid-row: span 4;
  display: grid;
  grid-template-rows: subgrid;

  border: 2px solid #000;
  box-shadow: 4px 4px 0 0 #222;
}

h2 {
  background-color: deepskyblue;
  color: white;
  padding: 0.5em;
}

.emoji {
  grid-row: 2;

  text-align: center;
  font-size: 5em;
}

p {
  padding: 0 1em;
}

span:last-of-type {
  justify-self: end;

  background-color: deepskyblue;
  color: white;
  padding: 0.5em;
}
              
            
!

JS

              
                
              
            
!
999px

Console