HTML CSS examples for CSS Widget:Menu Dropdown
Create drop down menu with OL and CSS
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .navigation {<!--from ww w. j av a 2 s . co m--> border: medium solid red; padding: 0; } .navigation li { display: inline-block; position: relative; } .navigation li ul { display: none; min-width: 100%; padding: 0; position: absolute; white-space: nowrap; } .navigation li ul li { background-image: url("https://www.java2s.com/style/demo/InternetExplorer.png"); display: block; margin-top: 2.5px; } .navigation li:hover ul { display: block; } .navigation li a { color: gray; margin: 0; padding: 5px; text-align: center; text-decoration: none; display: block; } .navigation li a:hover { color: darkgray; } .navigation li ul li a { background: none repeat scroll 0 0 gray; color: white; display: block; text-align: left; } nav .navigation li:first-child + li + li:hover, nav .navigation li:first-child + li + li + li + li + li + li:hover { background: blue; } </style> </head> <body> <nav> <ul class="navigation"> <li> <a href="">About</a> </li> <li> <a href="">Home</a> </li> <li> <a href="">Product</a> <ul> <li> <a href="">CSS</a> </li> <li> <a href="">HTML</a> </li> <li> <a href="">Oracle</a> </li> <li> <a href="">Database</a> </li> </ul> </li> <li> <a href="">Java</a> </li> <li> <a href="">Javascript</a> </li> <li> <a href="">C</a> </li> <li> <a href="">C++</a> <ul> <li> <a href="">Data</a> </li> <li> <a href="">SQL</a> </li> </ul> </li> </ul> </nav> </body> </html>