Mario: Dropdown-Menü

Beitrag lesen

ok, ist auch JS dabei, aber anders geht's mit IE eben nicht..schau dir das mal an..das ist so ziemlich das sauberste was ich gefunden habe. ohne allzuviel schnickschnack...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Menu</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
  function montre(id) {
   if (document.getElementById) {
    document.getElementById(id).style.display="block";
  } else if (document.all) {
    document.all[id].style.display="block";
  } else if (document.layers) {
    document.layers[id].display="block";
  } }

function cache(id) {
   if (document.getElementById) {
    document.getElementById(id).style.display="none";
  } else if (document.all) {
    document.all[id].style.display="none";
  } else if (document.layers) {
    document.layers[id].display="none";
  } }

//-->
</script>
<style type="text/css">
<!--
body {margin: 10px; padding: 0; font: 14px Verdana, sans-serif;}

ul, li {
list-style-type: none;
margin: 0;
padding: 0;
}

div.menu {
position: absolute;
width: 600px;
top: 10px;
z-index: 3;
}
div.menu li {
float: left;
width: 120px;
}

div.menu a {
margin: 0 2px;
height: 20px;
display: block;
text-align: center;
font-weight: bold;
border: 1px solid gray;
text-decoration: none;
color: #000;
background: #fff;
}

div.menu a:hover {
background: #ccc;
border: 1px solid gray;
}

#smenu1, #smenu2, #smenu3, #smenu4 {
display: none;
float: left;
width: 120px;
font-size: 12px;
}
#smenu1 a, #smenu2 a, #smenu3 a, #smenu4 a {
font-weight: normal;
border-top: 0 none;
}
.site {
position: absolute;
z-index: 1;
top : 70px;
left : 10px;
color: #000;
background-color: #ddd;
padding: 5px;
border: 1px solid gray;
}

.mentions {
position: absolute;
top : 300px;
left : 10px;
color: #000;
background-color: #ddd;
}
a {text-decoration: none;
color: #222;
}

-->
</style></head>

<body>

<div class="menu">
<ul><li><a onmouseover="montre('smenu1');" onmouseout="cache('smenu1');" href="">Menu 1</a> <ul style="display: none;" id="smenu1" onmouseover="montre('smenu1');" onmouseout="cache('smenu1');">
 <li><a href="">Subkategorie 1.1</a></li>
 <li><a href="">Subkategorie 1.2</a></li>
 <li><a href="">Subkategorie 1.3</a></li>
 </ul></li>
 <li><a onmouseover="montre('smenu2');" onmouseout="cache('smenu2');" href="">Menu 2</a><ul id="smenu2" onmouseover="montre('smenu2');" onmouseout="cache('smenu2');">
 <li><a href="">Subkategorie 2.1</a></li>
 <li><a href="">Subkategorie 2.2</a></li>
 </ul></li>
 <li><a onmouseover="montre('smenu3');" onmouseout="cache('smenu3');" href="">Menu 3</a><ul id="smenu3" onmouseover="montre('smenu3');" onmouseout="cache('smenu3');">
 <li><a href="">Subkategorie 3.1</a></li>
 <li><a href="">Subkategorie 3.2</a></li>
 <li><a href="">Subkategorie 3.3</a></li>
 <li><a href="">Subkategorie 3.4</a></li>
 <li><a href="">Subkategorie 3.5</a></li>
 </ul></li>
 <li><a onmouseover="montre('smenu4');" onmouseout="cache('smenu4');" href="">Menu 4</a><ul id="smenu4" onmouseover="montre('smenu4');" onmouseout="cache('smenu4');">
 <li><a href="">Subkategorie 4.1</a></li>
 <li><a href="">Subkategorie 4.2</a></li>
 <li><a href="">Subkategorie 4.3</a></li>
 </ul></li>
</ul>
</div>

</body></html>

Weiß jemand ein Tutorial oder hat jemand Tipps wie man ein Drop-Down-Menü mit reinem CSS realisieren kann.