Problem mit Ebenen und active
Hallo,
ich werkel da jetzt schon eine Weile herum, aber komme nicht auf die Lösung... bestimmt ist es gar nicht so schwer.
Also ich habe folgendes Menü:
http://i.imgur.com/WUDBx.png
Soweit in Ordnung... auch hover ist ok...
http://i.imgur.com/UNefY.png
Aber wenn man ein Unterpunkt anwählt, kommt das hier:
http://i.imgur.com/yq8b2.png
Natürlich soll es so aussehen wie bei a:hover
Das Problem ist nur, dass anscheinend die Regeln von der ersten und zweiten Ebene gleichzeitig angewandt werden und ich weiß nicht, wie ich das entwirren kann.
Hier der Code:
Code:
#subnav ul li{
width:200px;
}
#subnav ul li a:before{
content: "→";
margin-right:10px;
}
#subnav ul li a {
display: block;
padding: 10px 0px 10px 15px;
font-family: Helvetica, Arial, sans-serif;
font-weight: normal;
font-size: 12px;
color: #8C8B8A;
text-decoration: none;
border-bottom: 1px solid #c4c4c4;
}
#subnav ul li a:hover {
background-color: #235273;
color: #FFFFFF;
text-decoration: none;
}
#subnav ul li ul{
margin-bottom: 0px;
}
#subnav ul li ul li a {
padding: 10px 0px 10px 30px;
}
#subnav ul li ul li a:hover {
background-color: #235273;
color: #FFFFFF;
text-decoration: none;
}
#subnav ul li .submenu:before{
content: "↓";
margin-right:10px;
}
#subnav ul li .active.submenu:before{
content: "↓";
margin-right:10px;
}
#subnav ul li .active:before{
content: "→";
margin-right:10px;
}
#subnav ul li .active {
display: block;
padding: 10px 0px 10px 15px;
font-family: Helvetica, Arial, sans-serif;
font-weight: normal;
font-size: 12px;
text-decoration: none;
border-bottom: 1px solid #c4c4c4;
background-color: #235273;
color: #FFFFFF;
text-decoration: none;
}
#subnav ul li ul li .active:before{
content: ">>";
margin-right:10px;
}
#subnav ul li ul li .active {
display: block;
padding: 10px 0px 10px 30px;
font-family: Helvetica, Arial, sans-serif;
font-weight: normal;
font-size: 12px;
text-decoration: none;
border-bottom: 1px solid #c4c4c4;
background-color: #235273;
color: #FFFFFF;
text-decoration: none;
}
Das wichtige hier sind die letzten 4 Code-Elemente. Das davor ist nun um zu sehen wie ich das bei a und a:hover gemacht habe... hier ist nämlich die Darstellung in Ordnung.
Ich bin sicher, es gibt Optimierungsbedarf... :confused:
Wie kann man das am besten lösen?