/ Published in: CSS
The first thing you might notice is that I am not using nested lists to layout the menu. That is an old XHTML layout technique. I am using the more semantically correct HTML5 tag. Menus are not lists, they are navigation so using the more modern tag makes sense, and it turns out to be easier to work with.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Markup: <div id="menudiv"> <section class="menusection">Level 1 XXX <nav class="submenu"> <a href="xxx.php" title="Tooltip">Sub 1 XXX 1</a> <a href="xxx.php" title="Tooltip">Sub 1 XXX 2</a> <a href="xxx.php" title="Tooltip">Sub 1 XXX 3</a> <a href="xxx.php" title="Tooltip">Sub 1 XXX 4</a> <a href="xxx.php" title="Tooltip">Sub 1 XXX 5</a> </nav> </section> <section class="menusection">Level 1 YYY <nav class="submenu"> ... etc ... REPEAT for the number sections required </div> CSS: .menusection, .menusection2 { position:relative; width:15vw; float:left; border:1px solid black; z-index:10; height:1em; background-color:magenta; padding:3vh; border-radius:10px; } .menusection:hover { background-color:orange; transition-property:background-color; transition-duration:2s; transition-timing-function:ease-out; }
URL: http://coboldinosaur.com/pages/drop-down-menu.html