<nav>
  <button class="toggle-dropdown" aria-label="Nav toggle">
    <svg viewBox="0 0 448 512" width="100" title="bars">
      <path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z" />
    </svg>
  </button>
  <div class="dropdown">
    <a href="/">Home</a>
    <a href="/about">About</a>
    <a href="/projects">Projects</a>
    <a href="/contact">Contact</a>
  </div>
</nav>
@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700");

.dropdown.expanded {
  opacity: 1;
  display: flex;
}

.dropdown {
  opacity: 0;
  display: none;
  transition: opacity 0.2s, display 0.2s;
  /* you can ignore the rest of this */
  z-index: -1;
  height: 100vh;
  width: 100%;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
}

.dropdown a {
  font-size: 24px;
  font-weight: bold;
  margin: 20px;
}

.toggle-dropdown svg {
  width: 24px;
  height: auto;
  vertical-align: middle;
}

.toggle-dropdown {
  z-index: 1;
  cursor: pointer;
}

nav {
  position: relative;
}

html {
  font-family: "Open Sans";
}
const dropdown = document.querySelector(".dropdown");
const toggle = document.querySelector(".toggle-dropdown");

toggle.addEventListener("click", () => {
  dropdown.classList.toggle("expanded");
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.