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="popUp"></div> <!-- default pop up div -->
    <div class="dimmer"></div> <!-- "full screen" background behind .popUp div -->
    
    <header class="header clearfix">
        <div class="clearfix display-flex align-items contentHolder" data-items="center">
            <div class="logo"><a href=""><img src="http://placehold.it/230x60/" alt="logo Placeholder"></a></div>
            <nav class="menu">
                <ol>
                    <li class="mainMenu"><a href="">Menu 1</a></li>
                    <li class="mainMenu"><a href="">Menu 2</a>
                        <ul class="submenu">
                            <li class="subOption"><a href="">SubMenu 1</a></li>
                            <li class="subOption"><a href="">SubMenu 2</a></li>
                            <li class="subOption"><a href="">SubMenu 3</a></li>
                        </ul>
                    </li>
                    <li class="mainMenu mobileSub"><a href="">SubMenu 1</a></li>
                    <li class="mainMenu mobileSub"><a href="">SubMenu 2</a></li>
                    <li class="mainMenu mobileSub"><a href="">SubMenu 3</a></li>
                    <li class="mainMenu"><a href="">Menu 3</a></li>
                    <li class="mainMenu"><a href="">Menu 4</a></li>
                    <li class="mainMenu"><a href="">Menu 5</a></li>
                    <li class="mobileMenu mobileSocial">
                        <ul class="social">
                          <li><a target="_blank" href=""><svg viewBox="0 0 33 33"><g><path d="M 17.996,32L 12,32 L 12,16 l-4,0 l0-5.514 l 4-0.002l-0.006-3.248C 11.993,2.737, 13.213,0, 18.512,0l 4.412,0 l0,5.515 l-2.757,0 c-2.063,0-2.163,0.77-2.163,2.209l-0.008,2.76l 4.959,0 l-0.585,5.514L 18,16L 17.996,32z"></path></g></svg></a></li>
                            <li><a target="_blank" href=""><svg viewBox="0 0 33 33"><g><path d="M 32,6.076c-1.177,0.522-2.443,0.875-3.771,1.034c 1.355-0.813, 2.396-2.099, 2.887-3.632 c-1.269,0.752-2.674,1.299-4.169,1.593c-1.198-1.276-2.904-2.073-4.792-2.073c-3.626,0-6.565,2.939-6.565,6.565 c0,0.515, 0.058,1.016, 0.17,1.496c-5.456-0.274-10.294-2.888-13.532-6.86c-0.565,0.97-0.889,2.097-0.889,3.301 c0,2.278, 1.159,4.287, 2.921,5.465c-1.076-0.034-2.088-0.329-2.974-0.821c-0.001,0.027-0.001,0.055-0.001,0.083 c0,3.181, 2.263,5.834, 5.266,6.438c-0.551,0.15-1.131,0.23-1.73,0.23c-0.423,0-0.834-0.041-1.235-0.118 c 0.836,2.608, 3.26,4.506, 6.133,4.559c-2.247,1.761-5.078,2.81-8.154,2.81c-0.53,0-1.052-0.031-1.566-0.092 c 2.905,1.863, 6.356,2.95, 10.064,2.95c 12.076,0, 18.679-10.004, 18.679-18.68c0-0.285-0.006-0.568-0.019-0.849 C 30.007,8.548, 31.12,7.392, 32,6.076z"></path></g></svg></a></li>
                            <li><a target="_blank" href=""><svg viewBox="0 0 512 512">><path d="M256 109.3c47.8 0 53.4 0.2 72.3 1 17.4 0.8 26.9 3.7 33.2 6.2 8.4 3.2 14.3 7.1 20.6 13.4 6.3 6.3 10.1 12.2 13.4 20.6 2.5 6.3 5.4 15.8 6.2 33.2 0.9 18.9 1 24.5 1 72.3s-0.2 53.4-1 72.3c-0.8 17.4-3.7 26.9-6.2 33.2 -3.2 8.4-7.1 14.3-13.4 20.6 -6.3 6.3-12.2 10.1-20.6 13.4 -6.3 2.5-15.8 5.4-33.2 6.2 -18.9 0.9-24.5 1-72.3 1s-53.4-0.2-72.3-1c-17.4-0.8-26.9-3.7-33.2-6.2 -8.4-3.2-14.3-7.1-20.6-13.4 -6.3-6.3-10.1-12.2-13.4-20.6 -2.5-6.3-5.4-15.8-6.2-33.2 -0.9-18.9-1-24.5-1-72.3s0.2-53.4 1-72.3c0.8-17.4 3.7-26.9 6.2-33.2 3.2-8.4 7.1-14.3 13.4-20.6 6.3-6.3 12.2-10.1 20.6-13.4 6.3-2.5 15.8-5.4 33.2-6.2C202.6 109.5 208.2 109.3 256 109.3M256 77.1c-48.6 0-54.7 0.2-73.8 1.1 -19 0.9-32.1 3.9-43.4 8.3 -11.8 4.6-21.7 10.7-31.7 20.6 -9.9 9.9-16.1 19.9-20.6 31.7 -4.4 11.4-7.4 24.4-8.3 43.4 -0.9 19.1-1.1 25.2-1.1 73.8 0 48.6 0.2 54.7 1.1 73.8 0.9 19 3.9 32.1 8.3 43.4 4.6 11.8 10.7 21.7 20.6 31.7 9.9 9.9 19.9 16.1 31.7 20.6 11.4 4.4 24.4 7.4 43.4 8.3 19.1 0.9 25.2 1.1 73.8 1.1s54.7-0.2 73.8-1.1c19-0.9 32.1-3.9 43.4-8.3 11.8-4.6 21.7-10.7 31.7-20.6 9.9-9.9 16.1-19.9 20.6-31.7 4.4-11.4 7.4-24.4 8.3-43.4 0.9-19.1 1.1-25.2 1.1-73.8s-0.2-54.7-1.1-73.8c-0.9-19-3.9-32.1-8.3-43.4 -4.6-11.8-10.7-21.7-20.6-31.7 -9.9-9.9-19.9-16.1-31.7-20.6 -11.4-4.4-24.4-7.4-43.4-8.3C310.7 77.3 304.6 77.1 256 77.1L256 77.1z"/><path d="M256 164.1c-50.7 0-91.9 41.1-91.9 91.9s41.1 91.9 91.9 91.9 91.9-41.1 91.9-91.9S306.7 164.1 256 164.1zM256 315.6c-32.9 0-59.6-26.7-59.6-59.6s26.7-59.6 59.6-59.6 59.6 26.7 59.6 59.6S288.9 315.6 256 315.6z"/><circle cx="351.5" cy="160.5" r="21.5"/></g></svg></a></li>
                        </ul>
                    </li>
                </ol>
                <div class="hamburger"><span></span></div>
                <div class="dimmer"></div>
            </nav> 
<ul class="social">
  <li><a target="_blank" href=""><svg viewBox="0 0 33 33"><g><path d="M 17.996,32L 12,32 L 12,16 l-4,0 l0-5.514 l 4-0.002l-0.006-3.248C 11.993,2.737, 13.213,0, 18.512,0l 4.412,0 l0,5.515 l-2.757,0 c-2.063,0-2.163,0.77-2.163,2.209l-0.008,2.76l 4.959,0 l-0.585,5.514L 18,16L 17.996,32z"></path></g></svg></a></li>
  <li><a target="_blank" href=""><svg viewBox="0 0 33 33"><g><path d="M 32,6.076c-1.177,0.522-2.443,0.875-3.771,1.034c 1.355-0.813, 2.396-2.099, 2.887-3.632 c-1.269,0.752-2.674,1.299-4.169,1.593c-1.198-1.276-2.904-2.073-4.792-2.073c-3.626,0-6.565,2.939-6.565,6.565 c0,0.515, 0.058,1.016, 0.17,1.496c-5.456-0.274-10.294-2.888-13.532-6.86c-0.565,0.97-0.889,2.097-0.889,3.301 c0,2.278, 1.159,4.287, 2.921,5.465c-1.076-0.034-2.088-0.329-2.974-0.821c-0.001,0.027-0.001,0.055-0.001,0.083 c0,3.181, 2.263,5.834, 5.266,6.438c-0.551,0.15-1.131,0.23-1.73,0.23c-0.423,0-0.834-0.041-1.235-0.118 c 0.836,2.608, 3.26,4.506, 6.133,4.559c-2.247,1.761-5.078,2.81-8.154,2.81c-0.53,0-1.052-0.031-1.566-0.092 c 2.905,1.863, 6.356,2.95, 10.064,2.95c 12.076,0, 18.679-10.004, 18.679-18.68c0-0.285-0.006-0.568-0.019-0.849 C 30.007,8.548, 31.12,7.392, 32,6.076z"></path></g></svg></a></li>
  <li><a target="_blank" href=""><svg viewBox="0 0 512 512">><path d="M256 109.3c47.8 0 53.4 0.2 72.3 1 17.4 0.8 26.9 3.7 33.2 6.2 8.4 3.2 14.3 7.1 20.6 13.4 6.3 6.3 10.1 12.2 13.4 20.6 2.5 6.3 5.4 15.8 6.2 33.2 0.9 18.9 1 24.5 1 72.3s-0.2 53.4-1 72.3c-0.8 17.4-3.7 26.9-6.2 33.2 -3.2 8.4-7.1 14.3-13.4 20.6 -6.3 6.3-12.2 10.1-20.6 13.4 -6.3 2.5-15.8 5.4-33.2 6.2 -18.9 0.9-24.5 1-72.3 1s-53.4-0.2-72.3-1c-17.4-0.8-26.9-3.7-33.2-6.2 -8.4-3.2-14.3-7.1-20.6-13.4 -6.3-6.3-10.1-12.2-13.4-20.6 -2.5-6.3-5.4-15.8-6.2-33.2 -0.9-18.9-1-24.5-1-72.3s0.2-53.4 1-72.3c0.8-17.4 3.7-26.9 6.2-33.2 3.2-8.4 7.1-14.3 13.4-20.6 6.3-6.3 12.2-10.1 20.6-13.4 6.3-2.5 15.8-5.4 33.2-6.2C202.6 109.5 208.2 109.3 256 109.3M256 77.1c-48.6 0-54.7 0.2-73.8 1.1 -19 0.9-32.1 3.9-43.4 8.3 -11.8 4.6-21.7 10.7-31.7 20.6 -9.9 9.9-16.1 19.9-20.6 31.7 -4.4 11.4-7.4 24.4-8.3 43.4 -0.9 19.1-1.1 25.2-1.1 73.8 0 48.6 0.2 54.7 1.1 73.8 0.9 19 3.9 32.1 8.3 43.4 4.6 11.8 10.7 21.7 20.6 31.7 9.9 9.9 19.9 16.1 31.7 20.6 11.4 4.4 24.4 7.4 43.4 8.3 19.1 0.9 25.2 1.1 73.8 1.1s54.7-0.2 73.8-1.1c19-0.9 32.1-3.9 43.4-8.3 11.8-4.6 21.7-10.7 31.7-20.6 9.9-9.9 16.1-19.9 20.6-31.7 4.4-11.4 7.4-24.4 8.3-43.4 0.9-19.1 1.1-25.2 1.1-73.8s-0.2-54.7-1.1-73.8c-0.9-19-3.9-32.1-8.3-43.4 -4.6-11.8-10.7-21.7-20.6-31.7 -9.9-9.9-19.9-16.1-31.7-20.6 -11.4-4.4-24.4-7.4-43.4-8.3C310.7 77.3 304.6 77.1 256 77.1L256 77.1z"/><path d="M256 164.1c-50.7 0-91.9 41.1-91.9 91.9s41.1 91.9 91.9 91.9 91.9-41.1 91.9-91.9S306.7 164.1 256 164.1zM256 315.6c-32.9 0-59.6-26.7-59.6-59.6s26.7-59.6 59.6-59.6 59.6 26.7 59.6 59.6S288.9 315.6 256 315.6z"/><circle cx="351.5" cy="160.5" r="21.5"/></g></svg></a></li>
</ul>
      </div>
  </header>
              
            
!

CSS

              
                @import "compass";
// colors
$white: #fff;
$black:#000;
$secondary-color:#fff;
$hover-color:#808080;
// fonts
$font-serif-family:helvetica,
arial,
sans-serif;
// time
$transTime:0.5s;


// Responsive Sizes
$mobile:"max-width:767px";



$header-background-color:$black;

$header-link-color:$white;
$hamburger-color:"$header-link-color";

/* == Header ================================================= */

header {
  background-color: $header-background-color;
  border-bottom: 2px solid $hover-color;
  font-family: $font-serif-family;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 110;
  @include transition(top $transTime ease);
  &.hidden {
    top: -6em;
    @media screen and (max-width: 1024px) {
      top: -7em;
    }
    @media screen and (max-width: 600px) {
      .contentHolder {
        nav.menu {
          top: -3em;
        }
      }
    }
  }
  nav {
    float: right;
    margin-right: 15px;
    text-transform: uppercase;
    z-index: 95;
    ol {
      margin: 0;
      padding: 0;
      position: relative;
      li {
        display: inline-block;
        list-style: none;
        position: relative;
        margin: 0;
        padding: 0;
        &:hover ul {
          display: block;
        }
        &.mobileMenu {
          display: none;
        }
        &.mobileSub {
          display: none;
        }
        a {
          color: $header-link-color;
          cursor: pointer;
          display: block;
          font-size: ems(18px);
          padding: 30px 20px;
          position: relative;
          text-decoration: none;
          $border-width: 80%;
          &:after {
            content: '';
            border-bottom: 1px dashed $secondary-color;
            bottom: 21px;
            left: (100% - $border-width) / 2;
            opacity: 0;
            position: absolute;
            width: $border-width;
            z-index: 111;
            @include transition-property(opacity);
            @include transition-duration(0.35s);
          }
          &:visited {
            color: $secondary-color;
            &:after {
              content: '';
              opacity: 1;
            }
          }
          &:hover {
            color: $hover-color;
            &:after {
              content: '';
              opacity: 1;
            }
          }
          &.active {
            color: $hover-color;
            &:after {
              content: '';
              opacity: 1;
            }
            &:visited {
              color: $hover-color;
              &:after {
                content: '';
                opacity: 1;
              }
            }
          }
        }
        svg {
          display: none;
        }
      }
    }
    ol ul.submenu {
      background-color: $header-background-color;
      display: none;
      left: 0;
      padding: 10px 0;
      position: absolute;
      top: 100%;
      width:150px;
      @include box-shadow(0 1px 1px 2px rgba(0, 0, 0, 0.05));
      li {
        display: block;
        width: 100%;
        a {
          color: $secondary-color;
          line-height: 25px;
          padding: 10px 27px;
          text-decoration: none;
          &:after {
            content: '';
            display: none;
          }
          &:hover {
            color: $hover-color;
            background-color: $secondary-color;
          }
          &.button {
            border: none;
            color: $secondary-color;
            font-size: ems(18px);
            margin: 0;
            &:hover {
              background: none;
              color: $hover-color;
            }
          }
        }
      }
      li:before {
        content: "";
      }
    }
    .dimmer {
      left: 100%;
      z-index: 0;
      width: 100%;
      height: 100%;
      position: fixed;
      top: 0;
      background-color: rgba(0, 0, 0, 0.7);
      &.active {
        display: block;
        left: 50%;
        @include transition(all $transTime ease);
      }
    }
    .hamburger {
      display: none;
      z-index: 1;
    }
  }
  .contentHolder {
    padding: 0 25px;
    .logo a img {
      max-height: 50px;
    }
    @include display-flex; // delete this
    @include align-items(center); // delete this
    @media screen and (max-width: 1250px) {
      nav {
        ol li a {
          padding-left: 8px;
          padding-right: 8px;
        }
      }
      .logo {
        max-width: 325px;
      }
    }
    @media screen and (max-width: 1175px) {
      nav {
        ol li a {
          font-size: ems(17px);
        }
      }
      .logo {
        max-width: 300px;
      }
    }
    @media screen and (max-width: 1100px) {
      nav {
        ol li a {
          font-size: ems(16px);
          padding-left: 5px;
          padding-right: 5px;
        }
      }
      .logo {
        max-width: 285px;
      }
    }
    @media screen and (max-width: 1024px) {
      @include flex-wrap(wrap);
      nav {
        order: 2;
        width: 100%;
        margin-right: 0;
        padding-left: 25px;
        padding-right: 25px;
        ol {
          @include display-flex;
          @include justify-content(space-around);
          li a {
            font-size: ems(18px);
            padding: 18px;
            &:after {
              content: '';
              bottom: 14px;
            }
          }
        }
      }
      .logo {
        margin-top: 15px;
        max-width: 325px;
        padding-top: 0;
      }
    }
    @media screen and (max-width: 850px) {
      nav {
        padding-left: 12px;
        padding-right: 12px;
      }
    }
    @media screen and (max-width: 800px) {
      nav {
        padding-left: 0px;
        padding-right: 0px;
      }
    }
    @media only screen and ($mobile) {
      nav {
        ol {
          li a {
            font-size: ems(17px);
            padding-left: 10px;
            padding-right: 10px;
          }
          ul.submenu {
            li a {
              font-size: .8em;
            }
            &.sub-about {
              width: 218px;
            }
          }
        }
      }
    }
    @media screen and (max-width: 620px) {
      padding: 0;
      @include flex-direction(column);
      nav {
        display: block;
        height: 45px;
        left: 0;
        margin: 0;
        order: 1;
        position: fixed;
        top: 0px;
        width: 100%;
        @include transition(top $transTime ease);
        ol {
          background-color: $header-background-color;
          bottom: 0;
          display: block;
          left: 0;
          margin-left: -1000px;
          position: fixed;
          top: 0;
          width: 75vw;
          z-index: 20;
          @include transition(margin-left $transTime ease);
          &.active {
            margin-left: 0;
            overflow-y: scroll;
            @include transition(margin-left $transTime ease);
          }
          li {
            display: block;
            border-bottom: 1px dashed $secondary-color;
            &.mobileMenu {
              display: block;
              &.mobileSocial {
                border-bottom: none;
              }
              ul.social {
                display: block;
                margin: 0;
                padding-left: 15px;
                li {
                  border-bottom: none;
                  display: inline-block;
                  &:before {
                    content: "";
                  }
                  a {
                    width: inherit;
                    padding: 5px 5px 0 0;
                  }
                  svg {
                    width: 25px;
                    height: 25px;
                    margin: 10px 0;
                    path {
                      fill: $secondary-color;
                    }
                    &:hover {
                      path {
                        fill: $hover-color;
                        @include transition(all $transTime ease);
                      }
                    }
                  }
                }
              }
            }
            a {
              display: inline-block;
              font-size: ems(16px);
              padding: 16px 15px;
              width: 85%;
              color: $secondary-color;
              &:after {
                content: '';
                display: none;
              }
              &:visited {
                color: $hover-color;
              }
              &:hover {
                color: $hover-color;
              }
            }
            svg {
              cursor: pointer;
              display: inline-block;
              width: 18px;
              height: 18px;
              float: right;
              margin: 10px 15px 10px 0;
              path {
                fill: $secondary-color;
                @include transition(all $transTime ease);
              }
            }
          }
        }
        ol ul.submenu {
          background-color: $header-background-color;
          display: none;
          margin-top: -1px;
          max-height: 0;
          overflow: hidden;
          padding: 0;
          position: relative;
          width: 100%;
          li a {
            color: $secondary-color;
            font-size: ems(18px);
            &:hover {
              color: $hover-color;
            }
            &.button {
              background-color: $secondary-color;
              color: $white;
              border: none;
              margin: 0;
              max-width: 100%;
              text-align: left;
              &:hover {
                background-color: $hover-color;
                color: $white;
              }
            }
          }
          &.sub-about {
            width: 100%;
          }
        }
        .hamburger {
          display: inline-block;
          position: absolute;
          top: 22px;
          right: 10px;
          height: 100%;
          padding: 12px 25px;
          color: $hamburger-color;
          cursor: pointer;
          z-index:100;
          span {
            left: 0;
          }
          span,
          span:before,
          span:after {
            cursor: pointer;
            border-radius: 1px;
            height: 7px;
            width: 38px;
            background: $hamburger-color;
            position: absolute;
            display: block;
            content: '';
            transition: background 500ms ease-in-out;
          }
          span:before {
            top: -13px;
            transition: all 500ms ease-in-out;
          }
          span:after {
            bottom: -13px;
            transition: all 500ms ease-in-out;
          }
          &.active {
            span {
              background-color: transparent;
            }
            span:before,
            &.active span:after {
              top: 0;
            }
            span:before {
              transition: all 500ms ease-in-out;
              transform: rotate(-45deg);
            }
            span:after {
              transition: all 500ms ease-in-out;
              transform: rotate(45deg);
            }
          }
        }
      }
      .logo {
        order: 2;
        margin-bottom: 10px;
        margin-left: 21px;
        padding-top: 0;
        max-width: 100%;
        img {
          max-width: 100%;
        }
      }
      .social {
        display: none;
      }
    }
  }
  .logo {
    float: left;
    margin-right: auto;
    max-width: 350px;
  }
  @media screen and (max-width: 600px) {
    border-top: 0;
    position: relative;
  }
}

.no-scrolling {
  overflow: hidden;
  position: fixed;
}

.social {
  line-height: 0;
  margin: 0;
  padding: 0;
  svg {
    width: 25px;
    height: 25px;
    &:nth-child(1) {
      margin: 0 10px;
    }
    path {
      fill: $secondary-color;
    }
    &:hover {
      path {
        fill: $hover-color;
        @include transition(all $transTime ease);
      }
    }
  }
  li {
    list-style: none;
    display: inline-block;
    &:before {
      content: '';
    }
  }
}
              
            
!

JS

              
                   $('.hamburger').click(function (e) {
        $(this).parent().find('ol').toggleClass('active');
        $(this).toggleClass('active');
        $('.dimmer').toggleClass('active');
        $('body').toggleClass('no-scrolling');
    });

    $('li .icon-mobileMenu').click(function () {
        $(this).parent().toggleClass('active');
    });
              
            
!
999px

Console