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.

            
              <nav class="tt-nav" id="js-tt-nav">

  <ul class="tt-nav__list">

    <li class="tt-nav__item is-active" id="tt-home"><a href="#!" class="tt-nav__link">Home</a>
    <ul class="tt-nav__submenu">
      <li><a href="#!">Home</a></li>
    </ul>
    </li>
    <li class="tt-nav__item" id="tt-blog">
    <a href="#!" class="tt-nav__link">Blog</a>
    <ul class="tt-nav__submenu">
      <li><a href="#!">Blog</a></li>
      <li><a href="#!">Interviews</a></li>
    </ul>
    </li>
    <li class="tt-nav__item" id="tt-books"><a href="#!" class="tt-nav__link">Books</a>
    <ul class="tt-nav__submenu">
      <li><a href="#!">Books</a></li>
      <li><a href="#!">Magazines</a></li>
      <li><a href="#!">Magazines</a></li>
    </ul>
    </li>
    <li class="tt-nav__item" id="tt-goodies">
    <a href="#!" class="tt-nav__link">Goodies	</a>
    <ul class="tt-nav__submenu">
      <li><a href="#!">Drawings</a></li>
      <li><a href="#!">Ecards</a></li>
      <li><a href="#!">Fanmap</a></li>
      <li><a href="#!">General</a></li>
    </ul>
    </li>
    <li class="tt-nav__item" id="tt-media">
    <a href="#!" class="tt-nav__link">Media</a>
    <ul class="tt-nav__submenu">
      <li><a href="#!">Albums</a></li>
      <li><a href="#!">Albums-Extended</a></li>
      <li><a href="#!">7 Inch Singles</a></li>
      <li><a href="#!">12 Inch Maxi Singles</a></li>
      <li><a href="#!">CD Singles</a></li>
      <li><a href="#!">DVD-VHS-Blu-Ray</a></li>
      <li><a href="#!">Videos with others</a></li>
      <li><a href="#!">LP's</a></li>
    </ul>
    </li>
    <li class="tt-nav__item" id="tt-news"><a href="#!" class="tt-nav__link">News</a>
    <ul class="tt-nav__submenu">
      <li><a href="#!">News</a></li>
      <li><a href="#!">Film</a></li>
      <li><a href="#!">Photos</a></li>
      <li><a href="#!">Tour Photos ’08-’09</a></li>
      <li><a href="#!">Tour Photos ’10-’13</a></li>
      <li><a href="#!">Tours</a></li>
      <li><a href="#!">Videos</a></li>
      <li><a href="#!">Magazines</a></li>
      <li><a href="#!">Gossip</a></li>
      <li><a href="#!">Grapevine</a></li>
    </ul>
    </li>
    <li class="tt-nav__item" id="tt-contact"><a href="#!" class="tt-nav__link">Contact</a>
    <ul class="tt-nav__submenu">
      <li><a href="#!">Contact</a></li>
      <li><a href="#!">Appearances</a></li>
      <li><a href="#!">Credits</a></li>
      <li><a href="#!">Donation</a></li>
      <li><a href="#!">Forum</a></li>
    </ul>
    </li>
  </ul>
</nav>
            
          
!
            
              @font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v10/cJZKeOuBrn4kERxqtaUH3ZBw1xU1rKptJj_0jans920.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
} 

$tt-nav-hit-area:         44px;
$tt-nav-icon-size:        16px;
$blue:                    #079;
$accent-color:            $blue;
$tt-nav-color:            #fff;
$tt-nav-background:       #111;
$tt-nav-borders:          lighten($tt-nav-background, 10%);
$tt-nav-border-radius:    3px;
$width-1of7: (100 / 7) * 1%;
%reset {
  margin: 0;
  padding: 0;
  list-style: none;
}
%hem {
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
}

/* Submenu */
.tt-nav__submenu {
  margin: 0;
  padding: 0;
  list-style: none;
  position: absolute;
  left: -9999px;
  top: 100%;
  height: 0;
  overflow: hidden;
  z-index: 9;
  background-color: $accent-color;
  background-color: transparentize($accent-color,.125); 
  margin-left: 2px; 
  margin-right: 2px;   
  transition: padding-bottom .75s cubic-bezier(0.6, 0.4, 0.25, 0.75),background-color 2s; 
}
 .tt-nav__item:hover .tt-nav__submenu {
  left: 0;
  right: 0;
  background-color: rgba(black,.9);
}

/* calculate each dropdown list when hovered using css-transitions on `padding-bottom` when height is set to zero, the number of list-items: the class of `itemcount-[number] is added by javascript with this function using `each` */
/*  this spits out in the css something linke this: 

  [class*="itemcount-5"]:hover .tt-nav__submenu {
    padding-bottom: 230px;
}
* see also https://gist.github.com/atelierbram/a88e3811173bb9d75b40
*/

$item-count-list: 1 2 3 4 5 6 7 8 9 10;
$item-value-list: 46px 92px 138px 184px 230px 276px 322px 368px 414px 460px;
// declarations for small screen
@for $i from 1 through length($item-count-list) {
  [class*="itemcount-#{$i}"]:hover .tt-nav__submenu {
    padding-bottom: nth($item-value-list, $i);
  }
}
.tt-nav { 
  position: relative;
  max-width: 20em;
  overflow: hidden;
  font-size: 14px;
  font-size: .875rem;
  overflow: visible;
  float: left;
  width: 100%;
  max-width: 100%;
  padding-top: 1rem;
  background-color: $tt-nav-color; 
}

.tt-nav__list {
  @extend %reset;
  border-bottom-right-radius: $tt-nav-border-radius;
  border-bottom-left-radius: $tt-nav-border-radius;
  width: 100%;
}
.tt-nav__item {
  position: relative;
  float: left;
  width: $width-1of7;
  padding: 0 1px;
  box-sizing: border-box;
  /* border-top: 1px solid $tt-nav-borders; */
}
%tt-nav__link {
  display: block;
  white-space: nowrap;
  padding-right: ($tt-nav-hit-area - $tt-nav-icon-size) / 2;
  padding-left:  ($tt-nav-hit-area - $tt-nav-icon-size) / 2;
  line-height: $tt-nav-hit-area; 
} 
.tt-nav__link {
  position: relative;
  background-color: $tt-nav-background;
  color: $tt-nav-color; 
  @extend %tt-nav__link; 
  transition: background-color .25s;
  text-align: center;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  &:hover {
    background-color: $accent-color;
  } 
} 
.tt-nav__link::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 8px;
  top: 50%;
  right: 1.5em;
  margin-top:-3px; 
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPCAMAAADeWG8gAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFqqqqAAAABaH1EQAAAAJ0Uk5T/wDltzBKAAAAM0lEQVR42nzIUQoAIAzD0Ob+lxYE2Wat+QpP8nB40WUEYsomhkSiSyaaHKLkR6jOaQkwAC7CAH89ejUHAAAAAElFTkSuQmCC); 
  background-repeat: no-repeat;
  background-size: 100%;
  z-index: 2;
}
.tt-nav__submenu a {
  @extend %tt-nav__link;
  @extend %hem;
  font-size: 12px;
  font-size: .75rem; 
  transition: background-color .25s,color .5s .5s,border-color 1s 1.5s; 
  color: transparent;
  background-color: transparent;
} 
.tt-nav__item:hover .tt-nav__submenu a {
  color: $tt-nav-color;
  border-top-color: rgba(white,.1);
  border-bottom-color: rgba(black,.95);
} 
.tt-nav__item:hover .tt-nav__submenu a,
.is-active .tt-nav__submenu a {
  &:hover {
    background-color: $accent-color;
  } 
}
 
/* general styles */
html {
  font-size: 16px;
}
body {
  font: 100%/1.375 "Open Sans", sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100%;
}
a {
  text-decoration: none;
} 
            
          
!
            
              $(function() {
  var itms = {
  home    : ($("#tt-home li").length),
  blog    : ($("#tt-blog li").length),
  books   : ($("#tt-books li").length),
  goodies : ($("#tt-goodies li").length),
  media   : ($("#tt-media li").length),
  news    : ($("#tt-news li").length),
  contact : ($("#tt-contact li").length)
  };

 $.each( itms, function( i, val ) {
   $( "#tt-" + i ).addClass('tt-nav__itemcount-'+val);
 });

});
            
          
!
999px
Loading ..................

Console