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="grid">
  <button tabindex="0" popovertarget="image-1"><img src="https://hub.darn.es/content/images/2024/05/tetra-drip-usage.jpe" alt="Tetra Drip assembled and sat on top of a mug with a paper coffee filter in it" loading="lazy" width="2000" height="2000" srcset="https://hub.darn.es/content/images/size/w600/2024/05/tetra-drip-usage.jpeg 600w, https://hub.darn.es/content/images/size/w1000/2024/05/tetra-drip-usage.jpeg 1000w, https://hub.darn.es/content/images/size/w1600/2024/05/tetra-drip-usage.jpeg 1600w, https://hub.darn.es/content/images/2024/05/tetra-drip-usage.jpeg 2000w" sizes="33.3vw"></button>
  
  <img popover id="image-1" src="https://hub.darn.es/content/images/2024/05/tetra-drip-usage.jpeg" alt="Tetra Drip assembled and sat on top of a mug with a paper coffee filter in it" loading="lazy" width="2000" height="2000" srcset="https://hub.darn.es/content/images/size/w600/2024/05/tetra-drip-usage.jpeg 600w, https://hub.darn.es/content/images/size/w1000/2024/05/tetra-drip-usage.jpeg 1000w, https://hub.darn.es/content/images/size/w1600/2024/05/tetra-drip-usage.jpeg 1600w, https://hub.darn.es/content/images/2024/05/tetra-drip-usage.jpeg 2000w" sizes="100vw">
  
  <button tabindex="0" popovertarget="image-2">
    <img src="https://hub.darn.es/content/images/2024/05/tetra-drip.jpeg" alt="Tetra Drip" loading="lazy" width="2000" height="2000" srcset="https://hub.darn.es/content/images/size/w600/2024/05/tetra-drip.jpeg 600w, https://hub.darn.es/content/images/size/w1000/2024/05/tetra-drip.jpeg 1000w, https://hub.darn.es/content/images/size/w1600/2024/05/tetra-drip.jpeg 1600w, https://hub.darn.es/content/images/2024/05/tetra-drip.jpeg 2000w" sizes="33.3vw">
  </button>
  
  <img popover id="image-2" src="https://hub.darn.es/content/images/2024/05/tetra-drip.jpeg" alt="Tetra Drip" loading="lazy" width="2000" height="2000" srcset="https://hub.darn.es/content/images/size/w600/2024/05/tetra-drip.jpeg 600w, https://hub.darn.es/content/images/size/w1000/2024/05/tetra-drip.jpeg 1000w, https://hub.darn.es/content/images/size/w1600/2024/05/tetra-drip.jpeg 1600w, https://hub.darn.es/content/images/2024/05/tetra-drip.jpeg 2000w" sizes="100vw">
  
  <button tabindex="0" popovertarget="image-3">
    <img src="https://hub.darn.es/content/images/2024/05/munieq.jpeg" alt="A green sleeve about the size of a wallet" loading="lazy" width="2000" height="2000" srcset="https://hub.darn.es/content/images/size/w600/2024/05/munieq.jpeg 600w, https://hub.darn.es/content/images/size/w1000/2024/05/munieq.jpeg 1000w, https://hub.darn.es/content/images/size/w1600/2024/05/munieq.jpeg 1600w, https://hub.darn.es/content/images/2024/05/munieq.jpeg 2000w" sizes="33.3vw">
  </button>
  
  <img popover id="image-3" src="https://hub.darn.es/content/images/2024/05/munieq.jpeg" alt="A green sleeve about the size of a wallet" loading="lazy" width="2000" height="2000" srcset="https://hub.darn.es/content/images/size/w600/2024/05/munieq.jpeg 600w, https://hub.darn.es/content/images/size/w1000/2024/05/munieq.jpeg 1000w, https://hub.darn.es/content/images/size/w1600/2024/05/munieq.jpeg 1600w, https://hub.darn.es/content/images/2024/05/munieq.jpeg 2000w" sizes="100vw">
</div>
              
            
!

CSS

              
                .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: .5rem;
}

button {
  border: 0;
  padding: 0;
  line-height: 0;
  cursor: zoom-in;
}

[popover] {
  inline-size: 90vmin;
  block-size: 90vmin;
  border: 0;
  padding: 0;
}

::backdrop {
  background: rgba(0,0,0,0.75);
}

img {
  max-width: 100%;
  height: auto;
}
              
            
!

JS

              
                        
        

              
            
!
999px

Console