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

              
                <div class="container">
  <div class="header">
    <ul class="menu">
      <li>Home</li>
      <li>About</li>
      <li>Blog</li>
      <li>Projects</li>
      <li>Contact</li>
    </ul>
  </div>

  <div class="header2">
    <ul class="menu2">
      <li>Home</li>
      <li>About</li>
      <li>Blog</li>
      <li>Projects</li>
      <li>Contact</li>
    </ul>
  </div>

  <div class="header3">
    <ul class="menu3">
      <li>Home</li>
      <li>About</li>
      <li>Blog</li>
      <li>Projects</li>
      <li>Contact</li>
    </ul>
  </div>

  <div class="header4">
    <ul class="menu4">
      <li>Home</li>
      <li>About</li>
      <li>Blog</li>
      <li>Projects</li>
      <li>Contact</li>
    </ul>
  </div>

  <div class="header5">
    <ul class="menu5">
      <li>Home</li>
      <li>About</li>
      <li>Blog</li>
      <li>Projects</li>
      <li>Contact</li>
    </ul>
  </div>

</div>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.container {
  width: 100vw;
  height: 100vh;
  background: #4776e6;
  background: -webkit-linear-gradient(to right, #8e54e9, #4776e6);
  background: linear-gradient(to right, #8e54e9, #4776e6);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.header,
.header2,
.header3,
.header4,
.header5 {
  width: 100%;
  height: 60px;
  background: #4776e6;
  box-shadow: 0 0 10px 1px;
  margin-bottom: 40px;
}

.menu,
.menu2,
.menu3,
.menu4,
.menu5 {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0 100px;
}

.menu li,
.menu2 li,
.menu3 li,
.menu4 li,
.menu5 li {
  display: block;
  height: 100%;
  margin-right: 30px;
  font-size: 20px;
  position: relative;
  display: flex;
  align-items: center;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 0 15px #8e54e9;
  transition: all 300ms cubic-bezier(0.075, 0.82, 0.165, 1);
}

/* Style 1: color change and scale by 120% */
.menu li:hover {
  color: #111;
  transform: scale(1.2);
  text-shadow: none;
}

/* Style 2: Just transform 10px up and 10px down */
.menu2 li:hover {
  animation: anim2 500ms cubic-bezier(0.175, 0.885, 0.32, 0.275) infinite;
}

@keyframes anim2 {
  0% {
    opacity: 1;
    transform: translateY(px);
  }
  25% {
    opacity: 0;
    transform: translateY(-10px);
  }
  50% {
    opacity: 1;
    transform: translateY(0px);
  }
  75% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0px);
  }
}

/* Style 3: Just animate the :after element's width from 0 to 100% */

.menu3 li:after {
  content: "";
  position: absolute;
  width: 0%;
  height: 1px;
  display: block;
  transition: all 0.3s ease;
  bottom: 25%;
}
.menu3 li:hover::after {
  width: 100%;
  height: 1px;
  background-color: #fff;
}

/* Style 4: :before and :after element's width increased from 0 to 100%*/

.menu4 li:after,
.menu4 li:before {
  content: "";
  position: absolute;
  width: 0%;
  display: block;
  height: 1px;
  transition: all 0.3s ease;
  margin-top: 2px;
}

.menu4 li:after {
  bottom: 25%;
}

.menu4 li:before {
  top: 25%;
}

.menu4 li:hover::after {
  width: 100%;
  height: 1px;
  bottom: 25%;
  background-color: #fff;
}
.menu4 li:hover::before {
  width: 100%;
  height: 1px;
  top: 25%;
  background-color: #fff;
}

/* Style 5: :before and :after element's width increased from 0 to 100% */
/* Before element from right side and agter element from left side */

.menu5 li:after,
.menu5 li:before {
  content: "";
  position: absolute;
  width: 0%;
  display: block;
  height: 1px;
  transition: all 0.3s ease;
  margin-top: 2px;
  transition: all 300ms ease-in;
}

.menu5 li:after {
  bottom: 25%;
  left: 0;
}

.menu5 li:before {
  top: 25%;
  right: 0;
}

.menu5 li:hover::after {
  width: 100%;
  height: 1px;
  bottom: 25%;
  background-color: #fff;
}
.menu5 li:hover::before {
  width: 100%;
  height: 1px;
  top: 25%;
  background-color: #fff;
}

              
            
!

JS

              
                
              
            
!
999px

Console