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="grid">
  <div class="item">
    <h3>Card title</h3>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Modi expedita veritatis quibusdam quas facilis soluta deserunt aliquid molestias unde culpa. Voluptatibus doloribus doloremque harum ratione?</p>
  </div>
  <div class="item">
    <h3>Card title</h3>
    <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quas eligendi itaque odio aliquid excepturi vel corrupti deserunt veniam fuga perspiciatis! Nihil obcaecati quos similique consequatur dolore. Natus, corrupti.</p>
  </div>
  <div class="item">
    <h3>Card title</h3>
    <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Pariatur corporis porro mollitia praesentium quis minus.</p>
  </div>
  <div class="item">
    <h3>Card title</h3>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Aspernatur, iusto consectetur. Corporis consequatur architecto consequuntur blanditiis delectus sed aut, sint nihil ipsam voluptates quasi iure accusamus veniam quia soluta reprehenderit, quo quos!</p>
  </div>
  <div class="item">
    <h3>Card title</h3>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum ut repellat odit dolorem modi sapiente praesentium voluptas ullam placeat nostrum enim eligendi, commodi vitae recusandae in expedita architecto ex labore rem! Commodi, modi.</p>
  </div>
  <div class="item">
    <h3>Card title</h3>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo repellendus ex obcaecati facilis voluptatum corporis suscipit enim debitis quisquam!</p>
  </div>
  <div class="item">
    <h3>Card title</h3>
    <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Optio, maxime eum culpa facere sunt, inventore iste tenetur dignissimos perspiciatis quaerat quibusdam tempora.</p>
  </div>
  <div class="item">
    <h3>Card title</h3>
    <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Hic dolores illo aliquam!</p>
  </div>
  <div class="item">
    <h3>Card title</h3>
    <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Laborum quibusdam, placeat aliquid nam nemo earum, quos tenetur non architecto labore ullam aspernatur iure tempora numquam beatae reiciendis?</p>
  </div>
  <div class="item">
    <h3>Card title</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita, nesciunt similique.</p>
  </div>
</div>
              
            
!

CSS

              
                .grid {
  --gap: 20px;
  display: grid;
  gap: var(--gap);

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(
        max(
          50% - var(--gap),
          min(350px, 100%)
        ),
        1fr
      )
    );

  /* or */

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(
        min(100%, max(50% - var(--gap), 200px)),
        1fr
      )
    );

  /* or */

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(
        clamp(50% - var(--gap), 350px, 100%),
        1fr
      )
    );
}

.item {
  padding: 1.35rem;
  background: #90bcbc;
  border-radius: 4px;
}

h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}


body {
  padding: 20px;
  color: #332182;
}
              
            
!

JS

              
                
              
            
!
999px

Console