/ Published in: CSS
Simple 2 lines of CSS and you have a dropdown with hover.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<style> /* this is it */ div#menuContainer > ul {display:none;} div#menuContainer:hover > ul {display:block;} /* ---------- */ /* this is styling */ div#menuContainer > ul { cursor:pointer; } div#menuContainer li:hover { background-color:red; } div#menuContainer * { width:150px; border:solid 1px #000; } /* ---------- */ ​</style> <div id="menuContainer"> <div>Favorite Languages</div> <ul> <li>CSS3</li> <li>Javascript</li> <li>c#.net</li> <li>PHP</li> <li>Java</li> </ul> </div>​
URL: http://jsfiddle.net/ryanwfiorini/ZFmXW/