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

              
                <body>
  <!-- Header here -->
  <header>
    <nav class="
          flex flex-wrap
          items-center
          justify-between
          w-full
          py-4
          md:py-0
          px-4
          text-lg text-gray-700
          bg-white
        ">
      <div>
        <a href="#">
          Logo
        </a>
      </div>

      <svg xmlns="http://www.w3.org/2000/svg" id="menu-button" class="h-6 w-6 cursor-pointer md:hidden block" fill="none" viewBox="0 0 24 24" stroke="currentColor">
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
      </svg>

      <div class="hidden w-full md:flex md:items-center md:w-auto" id="menu">
        <ul class="
              pt-4
              text-base text-gray-700
              md:flex
              md:justify-between 
              md:pt-0">
          <li>
            <a class="md:p-4 py-2 block hover:text-purple-400" href="#">Startsida</a>
          </li>
          <li>
            <a class="md:p-4 py-2 block hover:text-purple-400" href="#">Tidsbokning</a>
          </li>
          <li>
            <a class="md:p-4 py-2 block hover:text-purple-400" href="#">Kontrakt</a>
          </li>
          <li>
            <a class="md:p-4 py-2 block hover:text-purple-400" href="#">Kalender</a>
          </li>
          <li>
            <a class="md:p-4 py-2 block hover:text-purple-400" href="#">Dokument</a>
          </li>
          <li>
            <a class="md:p-4 py-2 block hover:text-purple-400" href="#">Mina sidor</a>
          </li>
          </li>
        </ul>
      </div>
    </nav>
  </header>

  <!-- Sidebar -->
  <aside>
    <div class="w-60 h-full shadow-md bg-white px-1 absolute">
      <ul class="relative">
        <li class="relative">
          <a class="flex items-center text-sm py-4 px-6 h-12 overflow-hidden text-gray-700 text-ellipsis whitespace-nowrap rounded hover:text-gray-900 hover:bg-green-100 transition duration-300 ease-in-out" href="#!">Startsida</a>
        </li>
        <li class="relative">
          <a class="flex items-center text-sm py-4 px-6 h-12 overflow-hidden text-gray-700 text-ellipsis whitespace-nowrap rounded hover:text-gray-900 hover:bg-green-100 transition duration-300 ease-in-out" href="#!">Tidsbokning</a>
        </li>
        <li class="relative">
          <a class="flex items-center text-sm py-4 px-6 h-12 overflow-hidden text-gray-700 text-ellipsis whitespace-nowrap rounded hover:text-gray-900 hover:bg-green-100 transition duration-300 ease-in-out" href="#!">Kontrakt</a>
        </li>
        <li class="relative">
          <a class="flex items-center text-sm py-4 px-6 h-12 overflow-hidden text-gray-700 text-ellipsis whitespace-nowrap rounded hover:text-gray-900 hover:bg-green-100 transition duration-300 ease-in-out" href="#!">Kalender</a>
        </li>
        <li class="relative">
          <a class="flex items-center text-sm py-4 px-6 h-12 overflow-hidden text-gray-700 text-ellipsis whitespace-nowrap rounded hover:text-gray-900 hover:bg-green-100 transition duration-300 ease-in-out" href="#!">Dokument</a>
        </li>
        <li class="relative">
          <a class="flex items-center text-sm py-4 px-6 h-12 overflow-hidden text-gray-700 text-ellipsis whitespace-nowrap rounded hover:text-gray-900 hover:bg-green-100 transition duration-300 ease-in-out" href="#!">Mina sidor</a>
        </li>
      </ul>
    </div>
  </aside>
  <div class="px-4">
    <div class="
          flex
          justify-center
          items-center
          bg-white
          mx-auto
          max-w-2xl
          rounded-lg
          my-16
          p-16
        ">
      <h1 class="text-2xl font-medium">Navbar</h1>
    </div>
  </div>
</body>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Noto+Emoji&display=swap');

.emoji {
  font-family: 'Noto Emoji', sans-serif;
 }
              
            
!

JS

              
                const button = document.querySelector('#menu-button');
const menu = document.querySelector('#menu');


button.addEventListener('click', () => {
  menu.classList.toggle('hidden');
});


              
            
!
999px

Console