Created
August 8, 2013 06:33
-
-
Save jtmorris/6181999 to your computer and use it in GitHub Desktop.
CSS: Dropdown Menu - Horizontal with vertical sublevels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#main-nav { list-style-type: none; } | |
#main-nav ul { list-style-type: none; margin: 0; padding: 0; } | |
#main-nav a { display: block; width: 100%; height: 100%; text-align: center; line-height: 30px; } | |
/* Universal Level Code */ | |
#main-nav li { width: 175px; height: 30px; } | |
#main-nav li ul { position: absolute; display: none; } | |
#main-nav li:hover > ul { display: block; } | |
/* Level 1 */ | |
#main-nav > li { display: inline-block; } | |
/* Level 2 */ | |
#main-nav > li > ul > li { position: relative; } | |
/* Level 3 */ | |
#main-nav > li > ul > li > ul { position: absolute; top: 10%; left: 175px; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment