Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

Save Automatically?

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

              
                <article>
  <h1>Example Article</h1>
  <aside>
    by Miriam
    <time>March 11, 2021</time>
  </aside>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Minima, eligendi ipsum! Soluta modi repudiandae facilis, ad itaque optio, quod quasi blanditiis sed veritatis aut deleniti, sit nostrum ullam. Possimus, quasi.</p>
  <figure>
    <img src="https://assets.codepen.io/15542/sad.jpg" alt="young girl frowning" width="1110" height="624" />
  </figure>
  <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nihil commodi animi explicabo ipsa, esse quasi optio dolorum tenetur nostrum ratione delectus labore totam neque accusamus omnis, unde molestias porro quos?</p>
</article>
              
            
!

CSS

              
                article {
  display: grid;
  grid-template-columns:
    [full-start] 0
    [margin-start] minmax(0, 1fr)
    [wide-start] minmax(0, min(10ch, 100vw - 50em))
    [content-start] minmax(min-content, 60ch) [content-end]
    minmax(0, min(10ch, 100vw - 50em)) [wide-end]
    minmax(0, 1fr) [margin-end]
    0 [full-end];
  grid-gap: var(--gap, 1em 0.5em);
}

article > * {
  grid-column: var(--column, content);
  margin: 0;
}

figure {
  /* options: full | margin | wide | content | <grid-column-values> */
  --column: full;
}

@media (min-width: 65em) {
  aside {
    --column: margin-start / content-start;
    text-align: right;
  }
}

/* Layout */
html {
  font-size: min(1em + 0.5vw, 2em);
}

img {
  width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

aside {
  font-style: italic;
}

@media (min-width: 65em) {
  article {
    --gap: 1em;
  }

  aside {
    font-size: 0.8em;
  }

  time {
    display: block;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console