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

              
                <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 > * {
  grid-column: var(--column, content);
  outline: thin dotted;
}

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

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







@layer setup, grid;

@layer grid {
  article {
    display: grid;
    grid-template-columns:
      [full-start] 1em
      [margin-start] minmax(0, 1fr)
      [wide-start] minmax(0, min(15vw - 5ch, 10ch))
      [content-start] minmax(min-content, 45ch) [content-end]
      minmax(0, min(15vw - 5ch, 10ch)) [wide-end]
      minmax(0, 1fr) [margin-end]
      1em [full-end];
    gap: var(--gap, 1em 0);
    
    > * {
      margin: unset;
    }
  }
}

@layer setup {
  body {
    --text-small: clamp(0.938rem, 0.824rem + 0.568cqi, 1.25rem);
    --text-normal: clamp(1.25rem, 1.023rem + 1.136cqi, 1.875rem);
    --text-large: clamp(1.35rem, 0.818rem + 2.659cqi, 2.813rem);
    --text-xlarge: clamp(1.7rem, 0.784rem + 4.58cqi, 4.219rem);
    font-size: var(--text-normal);
    padding: var(--gap);
  }

  * {
    box-sizing: border-box;
  }

  html {
    block-size: 100%;
  }

  body {
    margin: unset;
    min-block-size: 100%;
  }

  img,
  svg {
    display: block;
    inline-size: 100%;
    block-size: auto;
  }

  picture {
    display: contents;
  }

  input,
  button,
  textarea,
  select {
    font: inherit;
  }

  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