我有一个导航菜单。但是菜单很疯狂。
子菜单类(如果悬停第一个菜单,这是下拉菜单)。“firstmenu”是网站的主要区域,因此是列表的第一级。
问题:子菜单获取 Firstmenus 值。甚至是里面的小箭头background: url(images/nav-arrow.png) no-repeat center bottom;
——但是为什么?!
我们已经对此进行了研究,拆分了代码,删除了typo3,所有的JavaScript,最后得到了这个css代码:
#firstmenu {
list-style: none;
margin: 0;
padding: 0;
}
#firstmenu .firstLevel {
float: left;
}
#firstmenu .firstLevel a {
display: block;
font-size: 1.166em;
font-weight: 600;
line-height: normal;
color: #333;
padding: 41px 20px 26px;
margin-bottom: 4px;
}
#firstmenu .firstLevel .current a,
#firstmenu .firstLevel a:hover,
#firstmenu .firstLevel a.selected {
color: #fff;
background: url(images/nav-arrow.png) no-repeat center bottom;
}
#firstmenu .firstLevel a:hover,
#firstmenu .firstLevel a.selected {
background-color: #333;
}
/* Drop-Down Menus */
.submenu {
list-style: none;
margin: 0;
padding: 0;
position: absolute;
}
.submenu > ul {
top: 4px !important;
}
.submenu .secoundLevel {
width: 200px;
background: #fca500;
}
.submenu .secoundLevel a {
display: block;
color: #fff;
padding: 8px 15px;
border-top: 1px solid rgba(255,255,255,0.2);
}
.submenu .secoundLevel a:hover {
background-color: #333;
border-color: #1a1a1a;
}
.submenu .secoundLevel:first-child a {
border-top: none;
}
有谁知道修复?
编辑,html:
<nav id="nav">
<ul id="firstmenu" class="clearfix">
<li class="firstLevel"><a href="index.php?id=99" >Startseite</a></li>
<li class="firstLevel current"><a href="index.php?id=91">Rootserver</a>
<ul class="submenu">
<li class="secoundLevel"><a href="index.php?id=96" >Vergleich</a></li>
</ul>
</li>
<li class="firstLevel"><a href="index.php?id=92">Voiceserver</a>
<ul class="submenu">
<li class="secoundLevel"><a href="index.php?id=97">Preisvergleich</a></li>
</ul>
</li>
</ul>
</nav>