I'm new with CSS and testing some stuff. I created a dropdown menu but this doesn't work correctly. Here is my code:
<!DOCTYPE html> <html> <head> <link href = "üben_css.css" rel = "stylesheet" type="text/css"> <title> xx</title> </head> <body> <div id="nav"> <ul> <li> Home </li> <li> xx <ul> <li> Hc </li> <li> Scc </li> </ul> <li>Zubehör </li> <li> Service </li> <li> Forum </li> </ul> </div> </body> </html> CSS code:
body{ margin:0; padding:0; } #nav{ background-color:silver; position:relative; } #nav ul li{ display:inline; } #nav ul ul{ display:none; } #nav ul li:hover ul{ display:block; } #nav ul ul li{ display:block; } The problem is that the nav bar is displayed inline but when I hover over my "xx" element the rest of my nav bar appear under my dropdown list. How can I fix this?
http://www.fotos-hochladen.net/uploads/20140921004u0kxad3i2r.png