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="wrapper">
  <div class="wrapper__item">
    <div class="card">
      <div class="card__thumb"></div>
      <div class="card__content">
        <h3 class="card__title">
          Inspect Element As A Way To Feed Your Curiosity
        </h3>
        <p class="card__desc">
          One of the best gifts we have as front-end developers is
          inspect element.
        </p>
      </div>
    </div>
  </div>
  <div class="wrapper__item">
    <div class="card">
      <div class="card__thumb"></div>
      <div class="card__content">
        <h3 class="card__title">
          Inspect Element A Your Curiosity
        </h3>
        <p class="card__desc">
          One of the best gifts we have as front-end developers is
          inspect element.
        </p>
      </div>
    </div>
  </div>
  <div class="wrapper__item">
    <div class="card">
      <div class="card__thumb"></div>
      <div class="card__content">
        <h3 class="card__title">
          Inspect Element As A Way Tosity
        </h3>
        <p class="card__desc">
          One of the best gifts we have as front-end developers is
          inspect element.
        </p>
      </div>
    </div>
  </div>
  <div class="wrapper__item">
    <div class="card">
      <div class="card__thumb"></div>
      <div class="card__content">
        <h3 class="card__title">
          Inspect Eleeed Your Curiosity
        </h3>
        <p class="card__desc">
          One of the best gifts we have as front-end developers is
          inspect element.
        </p>
      </div>
    </div>
  </div>
  <div class="wrapper__item">
    <div class="card">
      <div class="card__thumb"></div>
      <div class="card__content">
        <h3 class="card__title">
          Inspect Element As A Way To Feiosity
        </h3>
        <p class="card__desc">
          One of the best gifts we have as front-end developers is
          inspect element.
        </p>
      </div>
    </div>
  </div>
  <div class="wrapper__item">
    <div class="card">
      <div class="card__thumb"></div>
      <div class="card__content">
        <h3 class="card__title">
          Inspectfkdk fkd fdf d osity
        </h3>
        <p class="card__desc">
          One of the best gifts we have as front-end developers is
          inspect element.
        </p>
      </div>
    </div>
  </div>
  <div class="wrapper__item">
    <div class="card">
      <div class="card__thumb"></div>
      <div class="card__content">
        <h3 class="card__title">
          Inspect Element As A Way Tods ksapod kaspodkp oaskd r Curiosity
        </h3>
        <p class="card__desc">
          One of the best gifts we have as front-end developers is
          inspect element.
        </p>
      </div>
    </div>
  </div>
  <div class="wrapper__item">
    <div class="card">
      <div class="card__thumb"></div>
      <div class="card__content">
        <h3 class="card__title">
          Inspect Element As A Way Tr Curiosity
        </h3>
        <p class="card__desc">
          One of the best gifts we have as front-end developers is
          inspect element.
        </p>
      </div>
    </div>
  </div>
  <div class="wrapper__item">
    <div class="card">
      <div class="card__thumb"></div>
      <div class="card__content">
        <h3 class="card__title">
          Inspect Element As
        </h3>
        <p class="card__desc">
          One of the best gifts we have as front-end developers is
          inspect element.
        </p>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                .wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-gap: 1rem;
  max-width: 1400px;
  padding: 1rem;
  margin: 1rem auto;
  overflow: hidden;
  resize: horizontal;
}

.wrapper__item {
  container-type: inline-size;
  --horizontal: true;
}

.card {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 1rem;
}

.card__thumb {
  aspect-ratio: 4 / 3;
  flex: 0 0 150px;
  background-color: #4caf4c;
  border-radius: 7px;
  padding: 1rem;
  opacity: 0.5;
}

.card__title {
  color: lightgrey;
  font-weight: bold;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.card__desc {
  display: none;
}

.card__content {
  flex: 1;
}

@container (min-width: 500px) and style(--horizontal: true) {
  .card {
    flex-direction: row;
  }

  .card__thumb {
    aspect-ratio: 4/3;
    flex: 0 0 100px;
    align-self: flex-start;
  }
}

@container (min-width: 800px) {
  .card {
    position: relative;
    justify-content: center;
    align-items: center;
    min-height: 350px;
  }

  .card__thumb {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0.25;
  }

  .card__content {
    position: relative;
    flex: unset;
  }

  .card__title {
    font-weight: bold;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  .card__desc {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    color: #222;
  }
}

@font-face {
  font-family: "BLOKK";
  src: url("https://cdn.rawgit.com/octoshrimpy/blokkfont/e0dd7ffa/font/BLOKKNeue-Regular.woff2")
    format("woff2");
}

body {
  font-family: "BLOKK";
}

              
            
!

JS

              
                
              
            
!
999px

Console