Skip to content

Instantly share code, notes, and snippets.

@nirlanka
Created September 13, 2017 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nirlanka/c9c758e570582250296286b6b3c251e0 to your computer and use it in GitHub Desktop.
Save nirlanka/c9c758e570582250296286b6b3c251e0 to your computer and use it in GitHub Desktop.
Side-menu bar with sub-menu on hover (for a side-menu with only a few items)
#xx-submenu {
display: none;
}
#xx-submenu-trigger:hover + #xx-submenu,
#xx-submenu:hover {
display: block;
position: fixed;
left: 50px;
/* NOTE: don't set a top value */
z-index: 200 !important;
height: 200px;
background-color: green;
margin-top: -20px;
}
<div>
<ul class="nav navbar-nav side-nav">
<li title="Open submenu" id="xx-submenu-trigger-container">
<a id="xx-submenu-trigger">Submenu</a>
<div id="xx-submenu">[submenu content]</div>
</li>
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment