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

              
                <button id="menu-button" class="fixed top-3 left-3 z-10 p-2 border-4 bg-gray-100 border-gray-300">
  <svg viewBox="0 0 100 80" width="40" height="40">
    <rect width="100" height="20"></rect>
    <rect y="30" width="100" height="20"></rect>
    <rect y="60" width="100" height="20"></rect>
  </svg>
</button>
<aside id="sidebar" class="hidden fixed top-0 bottom-0 left-0 right-0 bg-gray-600 py-10">
  <nav class="text-center text-gray-200 text-2xl">
    <ul>
      <li class="py-4"><a class="hover:text-gray-400" href="#">Menu Item</a></li>
      <li class="py-4"><a class="hover:text-gray-400 py-4" href="#">Menu Item</a></li>
      <li class="py-4"><a class="hover:text-gray-400 py-4" href="#">Menu Item</a></li>
    </ul>
  </nav>
</aside>
<main class="container mx-auto my-20 font-sans">
  <h1 class="text-3xl text-center font-bold font-serif mb-4">Hello, World!</h1>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Officia voluptate autem ducimus deleniti vitae ipsam neque ab cum officiis! Asperiores deleniti esse nesciunt ipsum quis repellendus maiores repudiandae nulla dolor?</p>
</main>
              
            
!

CSS

              
                
              
            
!

JS

              
                const $sidebar = document.getElementById('sidebar');
const $menuButton = document.getElementById('menu-button');

$menuButton.addEventListener('click', e => {
  $sidebar.classList.toggle('hidden');
});
              
            
!
999px

Console