Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

Save Automatically?

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">
  <div class="card">
    <h2 class="nature">Nature</h2>
    <p>
      Nature, in the broadest sense, is the natural, physical, or material world or universe. "Nature" can refer to the phenomena of the physical world, and also to life in general. The study of nature is a large, if not the only, part of science. Although humans are part of nature, human activity is often understood as a separate category from other natural phenomena. 
    </p>
  </div>
  <div class="card">
    <h2 class="iceage">Ice Age <br />11,700 years ago</h2>
    <p>
      An ice age is a long period of reduction in the temperature of the Earth's surface and atmosphere, resulting in the presence or expansion of continental and polar ice sheets and alpine glaciers. Earth is currently in the Quaternary glaciation, known in popular terminology as the Ice Age.
    </p>
  </div>
</div>

<br /><br />
<h3>&nbsp; No Subgrid</h3>

<div class="container nosubgrid">
  <div class="card">
    <h2 class="nature">Nature</h2>
    <p>
      Nature, in the broadest sense, is the natural, physical, or material world or universe. "Nature" can refer to the phenomena of the physical world, and also to life in general. The study of nature is a large, if not the only, part of science. Although humans are part of nature, human activity is often understood as a separate category from other natural phenomena. 
    </p>
  </div>
  <div class="card">
    <h2 class="iceage">Ice Age <br />11,700 years ago</h2>
    <p>
      An ice age is a long period of reduction in the temperature of the Earth's surface and atmosphere, resulting in the presence or expansion of continental and polar ice sheets and alpine glaciers. Earth is currently in the Quaternary glaciation, known in popular terminology as the Ice Age.
    </p>
  </div>
</div>
              
            
!

CSS

              
                html, body {
  padding: 0;
  font-family: Roboto, Arial, sans-serif;
  max-width: 650px;
  margin: 50px auto;
}

.container {
  display: grid;
  grid-template-columns: repeat(2, minmax(50px, 1fr));
  grid-auto-rows: min-content;
  grid-gap: 10px;
  .card {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
  }
}

.nosubgrid .card {
  grid-row: auto;
  grid-template-rows: auto;
}


// just for styling
.card {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
  -webkit-box-shadow:0 0 10px rgba(0, 0, 0, 0.25);
  border-radius: 5px;
  padding: 10px;
}
h2 {
  margin: 0;
  padding: 40px 10px;
  color: white;
  text-shadow: 2px 2px 4px #000000;
}
.nature {
  background-image: url(https://source.unsplash.com/350x200/?nature);
}
.iceage {
  background-image: url(https://source.unsplash.com/350x200/?ice);
}
              
            
!

JS

              
                
              
            
!
999px

Console