Pen Settings



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


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


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.


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.


                <button id="open-dialog">Open Modal Dialog</button>
<dialog onsubmit="return false">
    <input type"text" />
<p>Pizza ipsum dolor sit amet, consectetur adipiscing elit. Fusce scelerisque, quam non fringilla commodo, elit justo accumsan nisl, vel convallis nulla quam vitae elit. Quisque interdum neque eu tortor efficitur, id volutpat nisl condimentum. Proin auctor lacinia justo, eget condimentum ligula blandit vel. Nullam sit amet sem non justo malesuada euismod. Sed ac lacinia tortor. Integer posuere tortor nec purus laoreet, id tempor elit eleifend.</p>

<p>Lorem ipsum pizza amet, consectetur adipiscing elit. Sed fermentum velit ut justo vehicula, eu rhoncus sem cursus. Nullam ac elit ac elit pharetra aliquet in at mauris. Vestibulum nec congue justo, sed tempus ipsum. Duis vel ullamcorper velit. Curabitur feugiat urna sit amet luctus efficitur. Aliquam accumsan mauris vel ante efficitur, non suscipit dolor accumsan.</p>

<p>Pizza ipsum dolor sit amet, consectetur adipiscing elit. In fermentum odio vel tellus luctus, in fermentum nibh euismod. Nullam nec lacus vitae odio pharetra hendrerit. Fusce sit amet nunc vel augue feugiat tristique. Mauris hendrerit libero vel quam sodales, vel mattis ex tincidunt. Nulla facilisi. Proin ullamcorper augue id augue pharetra, nec facilisis mauris rhoncus. Sed non condimentum ligula.</p>


                /* Uncomment below to see a backdrop  */ 
dialog::backdrop {
  background-color: purple;
  opacity: 0.55;
  filter: blur(100px);


                const modal = document.querySelector("dialog");

document.querySelector("#open-dialog").addEventListener("click", () => {

modal.querySelector("button").addEventListener("click", () => {