我正在尝试使用水平菜单按钮创建网页,其中一些按钮有下拉菜单。当悬停时,下拉列表将与下一个单元格重叠。该网页适用于Chrome,Foxfire和IE10 +。下拉列表在IE9及更低版本中不起作用。 在IE9中,如果下拉列表下方的下一个单元格中没有文本,则会显示下拉列表。如果有文本,则不显示下拉列表。 网址= http://www.arcolaalumni.org/Index_new.htm
CSS' horiznavbar5a.css'与水平导航栏有关:
body
{
font-family: "Calibri", sans-serif;
font-size: 100%;
font-style: normal;
color: #800080;
}
p
{
font-family: "Calibri", sans-serif;
font-size: 100%;
font-style: normal;
color: #800080;
}
ul#horiznav
{
padding: 0;
list-style-type: none;
height: 30px
width: 100%;
margin-top: -50px;
margin-bottom: 1px;
margin-right: 5px;
margin-left: 400px;
display: inline-table;
}
#horiznav ul
{
padding: 0;
list-style-type: none;
height: 30px
width: 100%;
margin-top: 1px;
margin-bottom: 1px;
margin-right: 5px;
margin-left: 5px;
display: inline-table;
}
#horiznav li
{
float: left;
width: 160px;
margin: 5px;
position: relative;
}
#horiznav li a
{
text-align: center;
text-decoration: none;
color: #ffffff;
margin: 5px;
padding: 2px 2px 5px 5px;
display: block;
width: 100%;
font-weight: bold;
font-size: 18;
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
background: #5006be;
}
#horiznav li a:hover {
color: #ffffff;
background: #b387f4;
font-weight: normal;
font-size: 18;
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
}
#horiznav li ul
{
display:none;
position:absolute;
left: 0; /*...align the left edge with the left edge of the parent li...*/
top: 22px; /*...and 22px down from the top - 20px height + 2px for the border*/
margin-top: 1px;
margin-bottom: 1px;
margin-right: 1px;
margin-left: 1px;
padding: 1px 1px 1px 1px;
}
#horiznav li:hover ul
{
display:block; /*display the ul when the parent li is hovered*/
position: absolute;
margin-top: 1px;
margin-bottom: 1px;
}
#horiznav li ul a
{
background-color:#5006be;
}