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

              
                
figcaption {
  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

              
                /* CSS Grid allows overlapping of cells. 

If two cells are siblings, you may overlap them easily with Grid.

However, if you want to overlap elements that are distantly related, you will still need to use relative and absolute positioning.



*/
              
            
!
999px

Console