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

              
                <p class="no-support-browser">ご利用のブラウザはsubgridに未対応です。<br>Chrome最新版か、Firefox・Safariでご確認ください</p>

<header class="global-header">
  <h1 class="brand-title"><b>CATS</b> MAGAZINE</h1>
</header>
<main class="main">
  <div class="card-container">
    <div class="card">
      <h2 class="card-title">Feeling Good</h2>
      <img class="image" src="https://assets.codepen.io/221808/gallery_1.jpg" width="360" height="240" alt="" />
      <p class="description">I AM A CAT. As yet I have no name.</p>
      <div class="label">
        <span class="material-symbols-outlined">pets</span>Goods
      </div>
    </div>
    <div class="card">
      <h2 class="card-title">What's going on here?</h2>
      <img class="image" src="https://assets.codepen.io/221808/gallery_2.jpg" width="360" height="240" alt="" />
      <p class="description">
        I have no idea where he was born. All I remember is that he used to
        meow and cry in a dim, dank place.
      </p>
      <div class="label">
        <span class="material-symbols-outlined">restaurant</span>Food
      </div>
    </div>
    <div class="card">
      <h2 class="card-title">
        Soon the sun was setting as the wind blew over the pond.
      </h2>
      <img class="image" src="https://assets.codepen.io/221808/gallery_3.jpg" width="360" height="240" alt="" />
      <p class="description">It was here that I first saw a human being</p>
      <div class="label">
        <span class="material-symbols-outlined">tibia</span>Health
      </div>
    </div>
    <div class="card">
      <h2 class="card-title">I was getting very hungry.</h2>
      <img class="image" src="https://assets.codepen.io/221808/gallery_4.jpg" width="360" height="240" alt="" />
      <p class="description">
        I later heard that it was a "shosei," the most ferocious and vicious
        race of human beings.
      </p>
      <div class="label">
        <span class="material-symbols-outlined">restaurant</span>Food
      </div>
    </div>
    <div class="card">
      <h2 class="card-title">I wanted to cry, but I couldn't speak</h2>
      <img class="image" src="https://assets.codepen.io/221808/gallery_5.jpg" width="360" height="240" alt="" />
      <p class="description">
        It is said that these "shosei" would sometimes catch us and boil us
        for food.
      </p>
      <div class="label">
        <span class="material-symbols-outlined">pets</span>Goods
      </div>
    </div>
    <div class="card">
      <h2 class="card-title">It was getting dark, and it was raining</h2>
      <img class="image" src="https://assets.codepen.io/221808/gallery_6.jpg" width="360" height="240" alt="" />
      <p class="description">
        But at the time, I had no idea what to expect
      </p>
      <div class="label">
        <span class="material-symbols-outlined">pets</span>Goods
      </div>
    </div>
  </div>
</main>
<footer class="global-footer">
  <address>Copyright © UNI OF THE DAY TEAM All Rights Reserved.</address>
</footer>
              
            
!

CSS

              
                .card-container {
  display: grid;
  gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.card {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 12px;
}

/* その他のスタイル */

:root {
  --gray: #f7f5f5;
  --padding: 24px;
  --base-color: #fcfcfc;
  --primary-color: #62b2f7;
  --text-color: #333333;
}

html,
body {
  background-color: var(--base-color);
}

body {
  font-family: "游ゴシック Medium", YuGothic, YuGothicM,
    "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  padding-top: var(--padding);
  color: var(--text-color);
  gap: var(--padding);
}

.material-symbols-outlined {
  font-size: 20px;
  margin-right: 6px;
  color: var(--primary-color);
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 48;
}

a {
  text-decoration: none;
}

img {
  filter: sepia(10%);
  object-fit: cover;
}

.global-header .brand-title {
  font-family: "Concert One", cursive;
  font-size: 40px;
  text-align: center;
}

.global-header .brand-title b {
  color: var(--primary-color);
}

.label {
  font-weight: bold;
  display: flex;
  align-items: center;
}

.main {
  padding-inline: var(--padding);
}

.card-container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
}

.card {
  border-top: 2px solid var(--primary-color);
  background-color: var(--gray);
  padding-block: 10px;
}

.card :is(.card-title, .description, .label) {
  padding-inline: 12px;
}

.card .card-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
  align-self: center;
}

.card .image {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.global-footer {
  display: grid;
  padding-top: 30px;
  padding-bottom: 20px;
  color: rgba(255, 255, 255, 0.5);
  background-color: #333333;
  justify-items: center;
}

.global-footer address {
  font-size: 12px;
  font-style: normal;
  padding-right: 16px;
  text-align: right;
}

.no-support-browser {
  display: none;
}

@supports not (grid-template-rows: subgrid) {
  .no-support-browser {
    display: block;
    font-weight: bold;
    color: #f429b4;
    margin-bottom: 16px;
    text-align: center;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console