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="my-container">
  <article>
    <h1>Resize the window 🥳</h1>
    <p>Lorem ipsum aliquam suscipit dictumst feugiat ultrices litora, curae netus libero integer aliquam cursus ultricies litora, praesent donec accumsan ornare ullamcorper etiam. Ultrices ad feugiat aliquam enim nam arcu accumsan aenean, nullam fermentum blandit pulvinar eleifend habitasse hendrerit tempor, litora suscipit nibh accumsan suspendisse mi tristique. Massa elit eleifend fusce ante ac augue leo fringilla praesent, sollicitudin dolor nostra consectetur ante conubia leo habitant curae adipiscing, orci malesuada turpis eleifend pharetra aliquet arcu magna.</p>
      <p>Id elementum metus vehicula sollicitudin faucibus id tempus etiam purus taciti curae torquent habitant convallis, praesent habitant ullamcorper pulvinar a curae vivamus congue turpis aliquam adipiscing taciti eleifend. Purus tristique cubilia mollis habitant primis mi aptent mattis quam, dui fringilla elementum proin etiam fames risus aenean iaculis, taciti lacus dictumst pulvinar facilisis neque ante ad. Porttitor velit quisque nisi integer congue semper auctor sit arcu, congue condimentum faucibus maecenas dictum nostra netus facilisis.</p>
        <p>Blandit gravida id ligula consequat senectus consequat torquent justo a, varius nam feugiat aenean velit feugiat metus feugiat et consectetur, mattis elementum ut torquent scelerisque lorem donec dictumst. Congue habitant semper integer nostra consectetur imperdiet eros augue inceptos, senectus fusce ac litora cubilia consectetur iaculis molestie. Curae lectus quisque arcu erat imperdiet aptent ultrices velit vestibulum, hac porttitor quis etiam nunc sagittis lobortis quam suspendisse, quam sodales amet curae interdum ut sagittis sem.</p>
          <p>Ante cras ultricies orci iaculis platea mollis id amet vel, eu diam nisl viverra suscipit integer primis in neque torquent, justo pulvinar nec urna fusce nisi viverra aliquet. Sit ligula mattis gravida lacus viverra neque proin, et suspendisse dapibus senectus scelerisque odio porta, erat viverra semper felis laoreet neque. Felis condimentum elit arcu curabitur ac sodales commodo magna bibendum, tortor suspendisse semper faucibus himenaeos sollicitudin molestie class primis, gravida lobortis tempus ornare tempus bibendum nullam sociosqu.</p>
            <p>Tempor nullam justo purus vehicula pellentesque gravida tempor quam eget, tellus odio pulvinar augue justo nunc class. Metus blandit tellus hac pellentesque malesuada ullamcorper imperdiet maecenas, per feugiat dapibus aenean mollis mattis diam ac, fringilla cubilia ligula duis aenean imperdiet a. Aliquam commodo ultrices rhoncus pretium malesuada consequat eros, dictumst ornare ut vivamus maecenas placerat proin, posuere dui varius ante nunc nec. Semper augue velit potenti viverra quisque curabitur sit dictum, ullamcorper risus pellentesque mauris odio ipsum eros aliquam blandit, lectus sagittis arcu placerat faucibus consectetur in.</p>
  </article>
</div>

              
            
!

CSS

              
                .my-container {
  border: 1px dashed;
  container-type: inline-size;
  margin: auto;
  overflow: hidden;
  padding: 1rem;
  resize: inline;
  width: calc(100% - 2rem); /* initial width */
  
  /* CSS nesting */
  article {
    gap: 1rem;
    
    /* Container query */
    @container (min-width: 40em) {
      columns: 2;
    }
  }
}

/* Additional styles to smarten things up a bit */
html {
  color-scheme: light dark;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

body {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 1em;

  h1 {
    font-size: 1.2em;
  }

  h1, p {
    margin-block-start: 0;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console