CodePen

HTML

            
              <nav>
    <ul id="nav" class="asdf">
        <li><a href="#">Category</a></li>
        <li><a href="#">Category</a></li>
        <li>
            <a href="#">Category</a>
            <ul class="level0">
                <li class="level1"><a href="#">Sub-cat</a></li>
                <li class="level1"><a href="#">Sub-cat</a></li>
                <li class="level1">
                    <a href="#">Sub-cat</a>
                    <ul class="level1">
                        <li class="level2"><a href="#">Sub-sub-cat</a></li>
                        <li class="level2"><a href="#">Sub-sub-cat</a></li>
                        <li class="level2"><a href="#">Sub-sub-cat</a></li>
                        <li class="level2"><a href="#">Sub-sub-cat</a></li>
                    </ul>
                </li>
                <li class="level1"><a href="#">Sub-cat</a></li>
            </ul>
        </li>
        <li><a href="#">Category</a></li>
        <li><a href="#">Category</a></li>
    </ul>
</nav>
            
          
!

↑ Insert the most common viewport meta tag

CSS

            
              nav li { 
  float:left; 
  position: relative;
  padding: 5px;
}

nav ul ul { 
  display: none; 
}

nav ul li:hover > ul { 
  display:block;
  position: absolute;
  top: 0;
  left: -50%;
  white-space: nowrap;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              
// Create the dropdown base
$("<select />").appendTo("nav");

// Create default option "Go to..."
$("<option />", {
   "selected": "selected",
   "value"   : "",
   "text"    : "Go to..."
}).appendTo("nav select");

// Populate dropdown with menu items
$("nav a").each(function() {
 var el = $(this);
 var prefix = (el.parent().hasClass('level1') == true) ? "- " : ""; 
 $("<option />", {
     "value"   : el.attr("href"),
     "text"    : prefix + el.text()
 }).appendTo("nav select");
});
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................