此菜单在 webkit 浏览器(Chrome 和 Safari)中完美运行,但我无法让下拉菜单在 Firefox 或 IE 中浮动,有人可以解释一下吗?坚持了几个小时
<ul>
<li><a>Large</a></li>
<li><a>Large</a></li>
<li>
<a>Extra Large</a>
<ul class="dropdown">
<li><a>This seems</a></li>
<li><a>To break in</a></li>
<li><a>Firefox/IE</a></li>
</ul>
</li>
<li><a>Extra Extra Large</a></li>
</ul>
ul {
padding: 0;
margin: 0;
display: table;
width: 100%;
}
li {
cursor: pointer;
list-style: none;
display: table-cell;
text-align: center;
border: 1px solid black;
max-width: 160px;
min-width: 100px;
position:relative;
}
a {
background: beige;
display: inline-block;
width: 100%;
}
ul.dropdown {
display: none;
position: absolute;
top: 18px;
left: 0;
}
ul.dropdown li {
cursor: pointer;
display: inline-block;
float: left;
}
ul li:hover > ul.dropdown {
display: block;
}
ul.dropdown li:hover a {
background: whiteSmoke;
}