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="challenge">
 <h1>Sparkbox CSS Challenge</h1>
 <p>Source: <a href="https://codepen.io/team/sparkbox/full/QWYzbeO">Sparkbox Code Challenges Generator<a> by <a href="https://codepen.io/kaseybon">@kaseybon</a></p>
 <p class="results">Your challenge is to build a(n) Card component. You need to use the Child selector at least once. You also need to use the scrollbar, overscroll-behavior, and grid-template-areas properties each at least once.</p>
</div>

<section class="card">
 <h2>Catherine is So Great 💖</h2>
 <img class="card__image" alt="" src="https://assets.codepen.io/466725/solar-flare.JPG?format=auto" />
 <div class="card__list">
  <h3>Great things about Catherine</h3>
  <ul>
   <li>She's smart (mostly)</li>
   <li>She is an excellent cook</li>
   <li>She tells cool stories</li>
   <li>She plays a <s>edgelord</s> Rogue/Warlock multiclass</li>
  </ul>
 </div>

 <div class="card__secrets">
  <h3>A cool cat for people who scroll</h3>
  <img alt="a cool cat like I said" src="https://assets.codepen.io/466725/kismet1.JPG?format=auto" />
 </div>

 <div class="card__extra-secrets">
  <h3>Secret Details About Kismet</h3>
  <p>Kismet is a cat, and, like most cats, she has knives for hands. She is about to smack me in the face in this picture. I'm not her favorite human. But she's mostly nice. </p>
 </div>
 <section>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700");

body {
 font-family: "Open Sans", sans-serif;
 overscroll-behavior: none;
}

.card {
 display: grid;
 grid-template-areas:
  "title title"
  "list image"
  "secrets extra";
 grid-gap: 2rem;
 justify-content: space-between;
 align-items: flex-end;
 max-width: 40rem;
 max-height: 22rem;
 padding: 2rem;
 margin: 0 auto;
 background-color: #b2ebf275;
 overflow: scroll;
}

.card img {
 display: block;
 width: 80%;
 max-width: 80%;
 margin: 0 auto;
 filter: drop-shadow(-0.75rem -0.75rem 0 #DB5AAA);
}

.card h2 {
 grid-area: title;
 text-align: center;
}

.card h3 {
 margin: 2rem 0;
}

.card > .card__list {
 grid-area: list;
}

.card > .card__image {
 grid-area: image;
 max-width: 100%;
}

.card > .card__secrets {
 grid-area: secrets;
 width: 100%;
}

.card > .card__extra-secrets {
 grid-area: extra;
 margin-top: 3rem;
}

.card__extra-secrets > p {
 overflow: scroll;
 width: 40%;
 height: 12rem;
 margin: 1rem auto;
 overscroll-behavior: contain;
 border: 2px solid #b2ebf2;
 padding: 2rem;
}

/* Classes from the challenge */


.challenge {
  max-width: 50rem;
  margin: 2rem auto;
  box-sizing: border-box;
}

.challenge a:link,
.challenge a:visited {
  color: #b1438f;
}

.challenge a:hover,
.challenge a:active {
  color: #00838F;
  text-decoration: none;
}

.challenge .results {
 padding: 2rem;
 background: #f8f8f8;
 margin-bottom: 2rem;
 line-height: 2;
}


              
            
!

JS

              
                
              
            
!
999px

Console