这很令人沮丧,我尝试了各种技巧来让它发挥作用。
这个 CSS 菜单的子项显示在主菜单上,我不确定为什么它不只是在下面做一个正常的下拉菜单。
显然我不能发布图像,因为我是新人。对不起!我希望你能理解我对它的解释。当您将鼠标悬停在父菜单项上时,下拉菜单实际上并没有从父菜单下方开始下拉。相反,它以与父级平行且相同的高度开始,这意味着它会遮挡父级菜单选项,因此您看不到它。
/*Primary nav*/
#menu {
background: #0072BC;
border-bottom: 3px solid #efefef;
border-top: 3px solid #efefef;
clear: both;
float: left;
margin-bottom: 1.5em;
text-align: center;
width: 100%;
}
#menu ul, .navbar ul {
list-style-type: none;
margin: 0 auto;
padding: 0;
width: 95%;
max-width: 62.5em;
}
#menu ul li, .navbar ul li {
display:block;
float: left;
list-style: none;
margin: 0;
padding: 0;
position: relative;
}
#menu ul li a, .navbar li a, .navbar li a:visited {
display: block;
float: left;
margin: 0;
padding: .75em;
}
#menu ul li a {
color: #fff;
font-size: .9em;
}
#menu ul li a:hover {
background: #fff;
color: #0072BC;
text-decoration: none;
}
ul#menu {
list-style: none outside none;
margin: 0;
padding: 0;
position: relative;
}
ul#menu ul {
display: none;
left: 0;
list-style: none outside none;
margin: 0;
padding: 0;
position: relative;
top: 100%;
width: 10.000em;
}
ul#menu ul ul, ul#menu ul ul ul {
left: 100%;
top: 0;
}
ul#menu li {
display: inline;
float: left;
margin: 0;
position: relative;
}
ul#menu ul li {
display: block;
width: 100%;
}
ul#menu a {
background: #efefef;
color: #666666;
display: block;
float: left;
height: 1%;
padding: 6px;
text-decoration: none;
}
#menu ul ul {
display: none;
left: -0.063em;
list-style: none outside none;
margin: 0;
padding: 0;
position: absolute;
width: 270px;
z-index: 100;
}
#menu ul ul li {
display: block;
width: 100%;
}
#menu ul ul li a {
}
#menu ul ul ul, #menu ul ul ul ul {
left: 100%;
top: -0.063em;
}
#menu ul a:hover, #menu ul li:hover a, #menu ul li.iehover a, #menu ul li.current-menu-item a, #menu ul li.current-menu-item a:visited {
background: none repeat scroll 0 0 #efefef;
color: #333;
}
#menu ul li:hover li a, #menu ul li.iehover li a, #menu ul li:hover li:hover li a, #menu ul li.iehover li.iehover li a, #menu ul li:hover li:hover li:hover li a, #menu ul li.iehover li.iehover li.iehover li a, #menu ul li:hover li:hover li:hover li:hover li a, #menu ul li.iehover li.iehover li.iehover li:hover li a {
background: none repeat scroll 0 0 #efefef;
color: #0072BC;
float: none;
font-size: .8em;
padding: .5em;
text-decoration: none;
z-index: 100;
}
#menu ul li:hover li a:hover, #menu ul li:hover li:hover a, #menu ul li.iehover li a:hover, #menu ul li.iehover li.iehover a, #menu ul li:hover li:hover li a:hover, #menu ul li:hover li:hover li:hover a, #menu ul li.iehover li.iehover li a:hover, #menu ul li.iehover li.iehover li.iehover a, #menu ul li:hover li:hover li:hover li a:hover, #menu ul li:hover li:hover li:hover li:hover a, #menu ul li.iehover li.iehover li.iehover li a:hover, #menu ul li.iehover li.iehover li.iehover li.iehover a, #menu ul li:hover li:hover li:hover li:hover li a:hover, #menu ul li:hover li:hover li:hover li:hover li:hover a, #menu ul li.iehover li.iehover li.iehover li.iehover li a:hover, #menu ul li.iehover li.iehover li.iehover li.iehover li.iehover a {
background: none repeat scroll 0 0 #efefef;
color: #333;
}
#menu ul li:hover ul ul, #menu ul li:hover ul ul ul, #menu ul li:hover ul ul ul ul, #menu ul li.iehover ul ul, #menu ul li.iehover ul ul ul, #menu ul li.iehover ul ul ul ul {
display: none;
}
#menu ul li:hover ul, #menu ul ul li:hover ul, #menu ul ul ul li:hover ul, #menu ul ul ul ul li:hover ul, #menu ul li.iehover ul, #menu ul ul li.iehover ul, #menu ul ul ul li.iehover ul, #menu ul ul ul ul li.iehover ul {
display: block;
}