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

              
                
<div class="container">
  <ul class="cards">
    <li class="card1">
      <header>
      <h2>Card title 1
        <br>is a longer title</h2>
      </header>
      <div class="content">
        <p>Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato. </p>
       </div>
        <footer> 
       <a href="/go-somewhere">More about card 1</a>
        </footer>
    </li>
        <li class="card2">
      <header>
      <h2>Card title 2</h2>
      </header>
      <div class="content">
        <p>Gumbo beet greens corn soko endive gumbo gourd</p>
       </div>
        <footer> 
       <a href="/go-somewhere">More about card 2</a>
        </footer>
    </li>
        <li class="card3">
      <header>
      <h2>Card title 3</h2>
      </header>
      <div class="content">
        <p>Celery quandong swiss chard chicory earthnut pea potato. Salsify taro catsear garlic gram celery bitterleaf wattle seed collard greens nori. Grape wattle seed kombu beetroot horseradish carrot squash brussels sprout chard.</p>
       </div>
        <footer> 
       <a href="/go-somewhere">More about card 3</a>
        </footer>
    </li>
       
  </ul>
</div>
              
            
!

CSS

              
                * { box-sizing: border-box; }

body {
  margin: 0;
  padding: 40px;
  font: 1.2em 'Open Sans', sans-serif;
  background-color: #fff;
}

.container {
  background-color: #ddddda;
  height: 720px;
  width: 1280px;
  padding: 20px 40px;
  position: relative;
}

.cards {
  font: 1em 'Averia Serif Libre', cursive;
  list-style-type: none;
  margin: 0;
  padding: .5em;
  background-color: #fff;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: dense;
}

.cards li {
  background-color: #374785;
  color: #fff;
  border-radius: .2em;  
  padding: .5em;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

@supports (grid-template-rows: subgrid) {
  .cards {
    grid-auto-rows: auto 1fr auto;
  }
  
  .cards li {
    grid-row: auto / span 3;
    grid-template-rows: subgrid;
    gap: 0;
  }
}

.cards header {
  border-bottom: 1px solid #fff;
  padding-bottom: .5em;
}

.cards footer {
  justify-self: center;
}

.cards footer a {
  display: inline-block;
  padding: .5em;
  color: #fff;
  text-decoration: none;
  background-color: #24305e;
  border-radius: .2em;
}

.cards footer a:hover,
.cards footer a:focus {
  background-color: #f76c6c;
  color: #171717;
}

.cards h2 {
  margin: 0;
}


              
            
!

JS

              
                
              
            
!
999px

Console