我有一个下拉菜单,但它不适用于 Internet Explorer 10(和兼容模式)和 Chrome。但是,它确实适用于 Firefox(最新)。
CSS:
#menu_items
{ float: left;
width: 600px;
}
#menu
{ margin:0;
float: left;
}
#menu li
{
padding: 0 0 0 0px;
list-style: none;
margin: 2px 0 0 0;
display: inline;
background: transparent;
}
#menu li a{
float: left;
font: bold 120% Arial, Helvetica, sans-serif;
text-align: center;
color: #FFF;
text-decoration: none;
height: 24px;
text-shadow: 0px 1px 0px #000;
padding: 16px 0px 10px 40px;
background: transparent;
}
#menu li ul li a {
float: left;
font: bold 90% Arial, Helvetica, sans-serif;
text-align: center;
color: #FFF;
text-decoration: none;
height: 24px;
text-shadow: 0px 1px 0px #000;
padding: 16px 0px 10px 40px;
background: transparent;
}
#menu li:hover ul {
display: flex;
float:inherit;
text-shadow: 0px 1px 0px #000;
padding: 1px 40px 0px 0px;
background: #669CD8;
background: -moz-linear-gradient(#90B9E2, #4B75AF);
background: -o-linear-gradient(#90B9E2, #4B75AF);
background: -webkit-linear-gradient(#90B9E2, #4B75AF);
margin: 50px 0px 0px 0px;
border-style:solid;
border-width:1px;
z-index: 2;
}
#menu li ul {
display: none;
position: absolute;
}
#menu li.current a, ul#menu li:hover a
{
color: #FFF;
text-decoration: underline;
}
HTML:
<div id="menu_items">
<ul id="menu">
<li class="current"><a href="index.html">Home</a></li>
<li><a href="werkwijze.html">Werkwijze</a></li>
<li><a href="#">Producten</a>
<ul>
<li><a href="klimaat.html" id="klimaat">Klimaat</a></li>
<li><a href="voerbakken.html" id="voerbakken">Voerbakken</a></li>
<li><a href="voerinstallatie.html" id="voerinstallatie">Voerinstallatie</a></li>
<li><a href="kraamhokken.html" id="kraamhokken">Kraamhokken</a></li>
<li><a href="boxen.html" id="boxen">Boxen</a></li>
<li><a href="bighok.html" id="bighok">Biggen hokken</a></li>
<li><a href="roosters.html" id="roosters">Roosters</a></li>
<li><a href="silos.html" id="silos">Silo's</a></li>
</ul>
</li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>