Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

  <section class="grid">
    <section class="one">
      <p>Both rows will adjust to their content with "max-content"</p>
    <section class="two">
      <p>Columns have a min of...?</p>
    <section class="three">
      <p>This whole row...<br><br>The columns adjust because they use "fr".</p>
    <section class="four">
      <p>...doesn't adjust its height... forever stuck at "200px"<br><br>The font in all cells is measured with "rem" and adjusts to the screen size.</p>
    <section class="four">
      <p>lauren ipkiss</p>
              body {
  font-family: arial;
  padding: 1%;

/* grid container */
.grid {
  display: grid;
    /* rows: repeat(2) */
    repeat(2, minmax(.12rem, max-content)) 
    / /* <- this slash divides rows and cols*/
    /* columns: left right */
    minmax(20%, 1fr) minmax(200px, 3fr);
  gap: .01rem;
  font-size: .02rem;

/* apply to all grid items */
.grid * {
  padding: calc( 1rem / 100); /* .01rem */

/* individual elements */
.one {
  background: #9966ff;
  border: 1px solid black;
.two {
  background: #6666ff;
  border: 1px solid black;
.three {
  background: #6699ff;
  border: 1px solid black; 
.four {
  background: #66ff99;
  border: 1px solid black;
              (function(doc, win) {
  var docEl = doc.documentElement,
    recalc = function() {
      var clientWidth = docEl.clientWidth;
      if (!clientWidth) return;

      docEl.style.fontSize = clientWidth + "px";
      docEl.style.display = "none";
      docEl.clientWidth; // Force relayout - important to new Androids
      docEl.style.display = "";

  // Abort if browser does not support addEventListener
  if (!doc.addEventListener) return;

  // Test rem support
  var div = doc.createElement("div");
  div.setAttribute("style", "font-size: 1rem");

  // Abort if browser does not recognize rem
  if (div.style.fontSize != "1rem") return;

  win.addEventListener("resize", recalc, false);
  doc.addEventListener("DOMContentLoaded", recalc, false);
})(document, window);

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.