cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <header class="fixed-header">
  <div class="head-control header-top">
    <div class="head-wrap">
      <div class="head-contact">
        <div class="head-contact-list">
          <div class="head-contact-item"><i class="fa fa-phone"></i> Call Us: 888-234-5456</div>
          <div class="head-contact-item"><i class="fa fa-envelope"></i> Email: info@example.com</div>
        </div>
      </div>

      <div class="head-social">
        <div class="head-social-list">
          <div class="head-social-item facebook">
            <a href="#"><i class="fa fa-facebook"></i></a>
          </div>
          <div class="head-social-item twitter">
            <a href="#"><i class="fa fa-twitter"></i></a>
          </div>
          <div class="head-social-item google-plus">
            <a href="#"><i class="fa fa-google-plus"></i></a>
          </div>
          <div class="head-social-item youtube">
            <a href="#"><i class="fa fa-youtube-play"></i></a>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="head-control header-mid">
    <div class="head-wrap">
      <div class="logo">
        <h1>Fixed</h1>
      </div>

      <nav class="primary-nav pull-right">
        <ul>
          <li><a href="#">Menu 1</a></li>
          <li class="has-columns"><a href="#">Menu 2</a>
            <ul>
              <li class="column-4"><a href="#">Child Title 1</a>
                <ul>
                  <li><a href="#">Child 1</a></li>
                  <li><a href="#">Child 2</a></li>
                  <li><a href="#">Child 3</a></li>
                </ul>
              </li>
              <li class="column-4"><a href="#">Child Title 2</a>
                <ul>
                  <li><a href="#">Child 1</a></li>
                  <li><a href="#">Child 2</a></li>
                  <li><a href="#">Child 3</a></li>
                </ul>
              </li>
              <li class="column-4"><a href="#">Child Title 3</a>
                <ul>
                  <li><a href="#">Child 1</a></li>
                  <li><a href="#">Child 2</a></li>
                  <li><a href="#">Child 3</a></li>
                </ul>
              </li>
              <li class="column-4"><a href="#">Child Title 4</a>
                <ul>
                  <li><a href="#">Child 1</a></li>
                  <li><a href="#">Child 2</a></li>
                  <li><a href="#">Child 3</a></li>
                </ul>
              </li>
            </ul>
          </li>
          <li><a href="#">Menu 3</a>
            <ul>
              <li><a href="#">Child 1</a></li>
              <li><a href="#">Child 2</a></li>
              <li><a href="#">Child 3</a>
                <ul>
                  <li><a href="#">Child 1</a></li>
                  <li><a href="#">Child 2</a></li>
                  <li><a href="#">Child 3</a></li>
                </ul>
              </li>
            </ul>
          </li>
          <li><a href="#">Menu 4</a></li>
          <li><a href="#">Menu 5</a></li>
          <li><a href="#">Menu 6</a></li>
        </ul>
      </nav>
    </div>
  </div>
</header>

<div class="main-content">
  <section class="container">
    <div class="row">
      <div class="col-md-12">
        <article class="content">
          <h1>Page Title</h1>

          <p>
            Nullam id dolor id nibh ultricies vehicula ut id elit. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vestibulum id ligula porta felis euismod semper. Maecenas
            faucibus mollis interdum. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
          </p>

          <p>
            Curabitur blandit tempus porttitor. Maecenas faucibus mollis interdum. Etiam porta sem malesuada magna mollis euismod. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nulla vitae elit libero, a pharetra augue. Curabitur
            blandit tempus porttitor. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
          </p>
        </article>
      </div>
    </div>

    <div class="row">
      <div class="col-md-12">
        <article class="content">
          <h3>Second Page Title</h3>

          <p>
            Nullam id dolor id nibh ultricies vehicula ut id elit. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vestibulum id ligula porta felis euismod semper. Maecenas
            faucibus mollis interdum. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
          </p>

          <p>
            Curabitur blandit tempus porttitor. Maecenas faucibus mollis interdum. Etiam porta sem malesuada magna mollis euismod. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nulla vitae elit libero, a pharetra augue. Curabitur
            blandit tempus porttitor. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
          </p>
        </article>
      </div>
    </div>
  </section>

  <section class="container">
    <div class="row">
      <div class="col-md-12">
        <article class="content">
          <h3>Page Title</h3>

          <p>
            Nullam id dolor id nibh ultricies vehicula ut id elit. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vestibulum id ligula porta felis euismod semper. Maecenas
            faucibus mollis interdum. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
          </p>

          <p>
            Curabitur blandit tempus porttitor. Maecenas faucibus mollis interdum. Etiam porta sem malesuada magna mollis euismod. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nulla vitae elit libero, a pharetra augue. Curabitur
            blandit tempus porttitor. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
          </p>
        </article>
      </div>
    </div>

    <div class="row">
      <div class="col-md-12">
        <article class="content">
          <h3>Second Page Title</h3>

          <p>
            Nullam id dolor id nibh ultricies vehicula ut id elit. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vestibulum id ligula porta felis euismod semper. Maecenas
            faucibus mollis interdum. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
          </p>

          <p>
            Curabitur blandit tempus porttitor. Maecenas faucibus mollis interdum. Etiam porta sem malesuada magna mollis euismod. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nulla vitae elit libero, a pharetra augue. Curabitur
            blandit tempus porttitor. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
          </p>
        </article>
      </div>
    </div>
  </section>
</div>
            
          
!
            
              // Built for educational purposes
// Self-hosted version works perfect in all browsers
// but for some reason the CodePen version doesn't
// work in Safari 8 for some reason.

$top-bar-starting-height:  40px;
$top-bar-scrolling-height: 0px;

$header-starting-height:  150px;
$header-scrolling-height: 60px;

$primary-accent-color:    #253B80;
$secondary-accent-color:  #179BD7;
$tertiary-accent-color:   #8DED10;

$facebook-brand-color:    #3b5998;
$twitter-brand-color:     #00aced;
$google-plus-brand-color: #dd4b39;
$youtube-brand-color:     #bb0000;
$linkedin-brand-color:    #007bb6;
$yelp-brand-color:        #B4282E;
$pinterest-brand-color:   #cb2027;

*, *:before, *:after {
  box-sizing: border-box;
}

body {
  color: #333;
  font-size: 16px;
  font-family: 'Roboto', sans-serif;
  line-height: 1.42857142;
}

a, a:focus, a:hover {
  outline: none;
  text-decoration: none;
}

// Header
header {
  width: 100%;
  position: relative;
  z-index: 2;
}

header.fixed-header {
  position: fixed;
  left: 0px;
  z-index: 999;
}

header.fixed-header .head-control {
  transition-property: background-color, box-shadow, line-height, height;
  transition-duration: 0.4s;
}

.head-control {
  font-size: 0px;
  margin: 0 auto;
  padding-left: 15px;
  padding-right: 15px;
  position: relative;
}

.head-wrap {
  width: 100%;
  max-width: 1170px;
  margin: 0 auto;
  position: relative;
  display: table;
}

// Top Bar
.header-top {
  background-color: darken($secondary-accent-color, 10%);
  height: $top-bar-starting-height;
  color: #fff;
  line-height: $top-bar-starting-height;
}

.head-contact {
  font-size: 13px;
  vertical-align: middle;
  line-height: $top-bar-starting-height;
  display: inline-block;
}

.head-contact-list { margin: 0 -10px; }

.head-contact-item {
  margin: 0px 10px;
  vertical-align: top;
  display: inline-block;
  white-space: nowrap;
}

.head-social {
  margin-left: 15px;
  vertical-align: top;
  float: right;
}

.head-social-list { font-size: 0px; }

.head-social-item {
  margin: 0px;
  display: inline-block;
  position: relative;
  vertical-align: middle;
}

.head-social-item a {
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 18px;
  text-align: center;
  line-height: 40px;
  overflow: hidden;
  display: block;
  position: relative;
}

.head-social-item i {
  font-size: 18px;
  line-height: 40px;
  position: relative;
  vertical-align: top;
}

.head-social-item a:before {
  width: 100%;
  height: 0;
  content: "";
  display: block;
  position: absolute;
  top: 0px;
  left: 0px;
  transition: height 0.3s ease 0s;
}

.head-social-item.facebook a:before {
  background-color: $facebook-brand-color;
}

.head-social-item.twitter a:before {
  background-color: $twitter-brand-color;
}

.head-social-item.google-plus a:before {
  background-color: $google-plus-brand-color;
}

.head-social-item.youtube a:before {
  background-color: $youtube-brand-color;
}

.head-social-item:hover a:before { height: 100%; }

// Logo & Nav
.header-mid {
  background-color: $primary-accent-color;
  width: 100%;
  line-height: $header-starting-height;
  box-shadow: 0px 2px 0px -1px rgba(0, 0, 0, 0.08);
}

.logo {
  float: left;
  clear: both;
  position: relative;
}

.logo h1 {
  margin: 0px;
  color: #fff;
  text-transform: uppercase;
  font-size: 50px;
  font-weight: 900;
  line-height: inherit;
  display: block;
}

nav.primary-nav {
  display: inline-block;
  vertical-align: middle;
}

nav.primary-nav ul {
  margin: 0px;
  padding: 0px;
  list-style-type: none;
  > li {
    float: left;
    position: relative;
    > a {
      height: 100%;
      margin: 0px;
      padding: 0 20px;
      color: #fff;
      font-size: 16px;
      font-weight: 300;
      text-align: center;
      text-transform: uppercase;
      display: block;
      position: relative;
      white-space: nowrap;
      overflow: hidden;
    }
    > ul {
      background-color: darken($primary-accent-color, 5%);
      min-width: 200px;
      height: auto;
      margin: 0px;
      padding: 0px;
      position: absolute;
      top: auto;
      left: auto;
      box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
      z-index: 9999;
      > li {
        float: none;
        display: block;
        position: relative;
        > a {
          padding: 10px 30px 10px 10px;
          color: #fff;
          font-size: 14px;
          font-weight: inherit;
          text-decoration: none;
          text-align: left;
          white-space: nowrap;
          line-height: 1.428571429;
          transition: all 0.3s ease;
          &:hover {
            background-color: darken($primary-accent-color, 10%);
          }
        }
        > ul {
          min-width: 200px;
          position: absolute;
          display: block;
          top: 0px;
          left: 100%;
          box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
          > li {
            float: none;
            display: block;
            position: relative;
          }
        }
      }
    }
  }
}

// Column Subnav Config
nav.primary-nav ul > li[class*="columns"] {
  position: static;

  > ul {
      width: 100%;
      min-width: 200px;
      padding: 15px 0;
      left: 0px;
      right: 0px;
      //Fix for child inline-block elements
      font-size: 0px;
      line-height: 0px;

    > li[class*="column"] {
        padding: 0 15px;
        display: inline-block;
        vertical-align: top;
        position: relative;

      a.column-title {
        background-color: transparent !important;
        font-weight: bold;
        cursor: text;
        border-bottom: 1px solid rgba(255,255,255,0.2);
      }
      > ul {
        position: static;
        box-shadow: none;

        > li a {
          white-space: normal;
        }
      }
    }
  }
}

nav.primary-nav > ul > li > a:after {
  background-color: $secondary-accent-color;
  height: 5px;
  content: "";
  position: absolute;
  left: 0px;
  right: 100%;
  bottom: 0px;
  transition: all 0.3s ease;
}

nav.primary-nav > ul > li:hover > a::after {
  right: 0px;
}

// Column Nav widths
nav.primary-nav ul li[class*="columns"] li.column-2 { width: 50%; }
nav.primary-nav ul li[class*="columns"] li.column-3 { width: 33.3333%; }
nav.primary-nav ul li[class*="columns"] li.column-4 { width: 25%; }
nav.primary-nav ul li[class*="columns"] li.column-5 { width: 20%; }

// Flyout Arrow
.nav-arrow {
  width: 20px;
  height: 20px;
  margin-top: -10px;
  text-align: center;
  position: absolute;
  right: 5px;
  top: 50%;
  display: none;
  line-height: 1.428571429 !important;
}

.nav-arrow:before {
  content: "\f105";
  font-size: 16px !important;
  font-family: fontawesome;
  color: #fff;
}

// Fix flickering issue on page load
nav.primary-nav > ul > li > ul {
  visibility: hidden;
  opacity: 0;
}

// Fade in/out with transitions
nav.primary-nav li:hover > ul  {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s,visibility 0.3s;
}

nav.primary-nav li:not(.has-columns) ul > li:hover > ul {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s,visibility 0.3s;
}

nav.primary-nav li:not(.has-columns) ul > li > ul {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.1s,visibility 0.1s;
}

/* == Sticky Stuff == */

header.sticky .header-top {
  height: $top-bar-scrolling-height;
  line-height: $top-bar-scrolling-height;
}

header.sticky .header-mid,
header.sticky .header-mid .logo h1,
header.sticky .header-mid nav.primary-nav ul {
  line-height: $header-scrolling-height;
  // Below is needed for CodePen to work properly for some reason
  transition-property: background-color, box-shadow, line-height, height;
  transition-duration: 0.4s;
}

header.fixed-header + div.main-content { padding-top: ceil($top-bar-starting-height + $header-starting-height) !important; }

.container {
  padding-left: 0px;
  padding-right: 0px;
}

article.content {
  padding-top: 50px !important;
}

            
          
!
            
              $(window).scroll(function() {
  if ($(this).scrollTop() > 1) {
    $('header.fixed-header').addClass("sticky");
  } else {
    $('header.fixed-header').removeClass("sticky");
  }
});

$(document).ready(function() {

  if (Modernizr.csstransitions) {
    console.log('using transitions for menus');
    // Use CSS transitions for the fade
    $('.primary-nav li:not(.has-columns) ul > li').append('<span class="nav-arrow"></span>');
    $('.primary-nav li:not(.has-columns) ul > li:has(ul) > span').css('display', 'block');

  } else {
    console.log('using jquery fade for menus');
    // css('visibility', 'visible') to undo the visibility hide/show stuff in CSS (to support IE8 display fading)

    $('.primary-nav li:not(.has-columns) ul > li').append('<span class="nav-arrow"></span>');
    $('.primary-nav li:not(.has-columns) ul > li:has(ul) > span').css('display', 'block');

    $('.primary-nav > ul > li > ul').css('visibility', 'visible').hide();
    $('.primary-nav > ul > li:has(ul)').hover(
      function() {
        //show its submenu
        $(this).find('> ul').fadeIn(100);
      },
      function() {
        //hide its submenu
        $(this).find('> ul').fadeOut(300);
      }
    );
  }

  $('li.column-2 > a').removeAttr('href').addClass("column-title");
  $('li.column-3 > a').removeAttr('href').addClass("column-title");
  $('li.column-4 > a').removeAttr('href').addClass("column-title");
  $('li.column-5 > a').removeAttr('href').addClass("column-title");
});
            
          
!
999px
Loading ..................

Console