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="row">
  <figure>
    <img src="https://assets.codepen.io/296057/fem-fb-one.png" alt="Image of bubbles through a microscope." />
    <figcaption>
      <h2>Bubbles</h2>
      <p>Lorem ipsum dolor sit amet.</p>
    </figcaption>
  </figure>
  <figure>
    <img src="https://assets.codepen.io/296057/fem-fb-two.png" alt="Grid of grey squares with green wells." />

    <figcaption>
      <h2>Green or Grey</h2>
      <p>Lorem ipsum dolor sit amet.</p>
    </figcaption>
  </figure>
  <figure>
    <img src="https://assets.codepen.io/296057/fem-fb-three.png" alt="Wavy lines in summery colors like orange, light purple, and yellow." />

    <figcaption>
      <h2>Summer Waves</h2>
      <p>Lorem ipsum dolor sit amet.</p>
    </figcaption>
  </figure>
  <figure>
    <img src="https://assets.codepen.io/296057/fem-fb-four.png" alt="Fibronacci sequence of spirals." />

    <figcaption>
      <h2>Spiraling Away</h2>
      <p>Lorem ipsum dolor sit amet.</p>
    </figcaption>
  </figure>
</div>
              
            
!

CSS

              
                figure {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, auto);
}
img {
  /* image must stretch across all rows */
  grid-row: 1/3;
  grid-column: 1/2;
}
figcaption {
  grid-column: 1/2;
  /* caption overlaps the last row with the image */
  grid-row: 2/3;
  opacity: 0.7;
}


/* Basic figure and caption styling */
/* Turn off margin, set by browser */
figure {
  margin: 0;
  padding: 0;
}
/* caption styling  */
figcaption {
  background-color: #001219;
  color: white;
  padding: 1rem;
}
/* reduces the top margin on the h2, bottom on the p, and leaves a 0.5rem gap between the two */
figcaption * {
  margin: 0.5rem;
}
/* hack to make images flexible */
img {
  width: 100%;
}


@media (min-width: 600px) {
  .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2%;
  }
  
}


/* default styling, no changes needed here, even with responsive design */

/* set the layout to border box model */
html {
  box-sizing: border-box;
}
*,
*::before,
*::after {
  box-sizing: inherit;
}
/* set font family and background gradient */
body {
  padding: 0;
  border: 0;
  font-family: Tahoma, Arial, sans-serif;
}

              
            
!

JS

              
                
              
            
!
999px

Console