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.


Save Automatically?

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.


                <div class="header">
  <div class="header__inner flex--end">
      <label id="burger">
      <nav class="sidemenu">
          <li><a href="#">Home</a></li>
          <li><a href="#">Blog</a></li>
          <li><a href="#">About</a></li>
          <li><a href="#">Contact</a></li>
          <li><a href="#">Get in Touch</a></li>


                @import url( + One);
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
.flex--end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
.header {
  height: 96px;
  position: fixed;
  width: 100%;
  background-color: #fcd232;
  box-shadow: 0px 1px 10px 0px rgba(83, 83, 83, 0.68);
.header__inner {
  width: 90%;
  margin: 0 auto;
.sidemenu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #302f38;
  transform: translateX(-100%);
  transition: all 0.3s ease-in-out 0s;
/* active class on menu */ {
  transform: translateX(0%);
#burger {
  cursor: pointer;
  width: 30px;
  height: 27px;
  display: flex;
  justify-content: space-between;
  flex-direction: column;
#burger > div {
  height: 4px;
  z-index: 999;
  border-radius: 20px;
  align-self: flex-end;
  width: 100%;
  background-color: #302f38;
  transition: 0.2s ease-in-out;
.sidemenu ul {
  margin: 96px 0 0 20px;
.sidemenu ul li {
  list-style-type: none;
  margin-bottom: 30px;
.sidemenu ul li a {
  font-family: "Tangerine", serif;
  text-decoration: none;
  color: #fff;
  font-size: 18px;
  text-transform: uppercase;
#burger div:nth-child(2) {
  width: 80%;
#burger div:nth-child(3) {
  width: 60%;
#burger:hover div {
  width: 100%;
/* active class on burger*/ div:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
  background-color: #fff;
  width: 100%;
} div:nth-child(2) {
  opacity: 0;
  background-color: #fff;
} div:nth-child(3) {
  transform: translateY(-12px) rotate(-45deg);
  background-color: #fff;
  width: 100%;



                // Selection of HTML objects
const burger = document.querySelector("#burger");
const sidemenu = document.querySelector(".sidemenu");
const sidemenuLink = document.querySelectorAll(".sidemenu ul li a");

// Defining a function
function toggleMenu() {

// Calling the function after click event occurs
sidemenuLink.forEach((link) => {
  link.addEventListener("click", toggleMenu);
burger.addEventListener("click", toggleMenu);