Ich habe ein Dropdown Menü in CSS gestaltet, es funktioniert auch alles bis auf das es nicht aufklappt beim hovern. Das liegt wahrscheinlich daran, das ich nicht weiß wie ich mit
- Code: Alles auswählen
#menu li:hover ul {}
- Code: Alles auswählen
#menu ul.year {}
ansprechen soll.
Der gesamte CSS Code ist
- Code: Alles auswählen
ul, li {
margin: 0px;
padding: 0px;
}
#menu {
width: 100%;
background: #000000;
font: 14px 'DroidSansMonoRegular', Arial, sans-serif;
line-height: 1.7;
float: left;
}
#menu ul {
float: left;
list-style-type: none;
}
#menu ul.year {
float: left;
width: 140px;
list-style-type: none;
}
#menu ul.films {
float: left;
width: 250px;
list-style-type: none;
}
#menu ul.screenings {
float: left;
width: 200px;
list-style-type: none;
}
#menu p {
font-size: 14px;
text-align: left;
color: #00ff00;
background: #000000;
}
#menu a.year:link {
text-decoration: none;
display: block;
border-top: 1px dashed #00ff00;
text-align: left;
background: #000000;
color: #00ff00;
list-style-type: none;
width: 110px;
}
#menu a.year:hover {
color: #000000;
background: #00ff00;
width: 110px;
}
#menu a.films:link {
text-decoration: none;
display: block;
border-top: 1px dashed #00ff00;
text-align: left;
background: #000000;
color: #00ff00;
list-style-type: none;
width: 220px;
}
#menu a.films:hover {
color: #000000;
background: #00ff00;
width: 220px;
}
#menu li {
position: relative;
}
#menu ul ul {
position: absolute;
left: -9999px;
}
#menu li:hover ul {
left: auto;
}
Der HTML Code
- Code: Alles auswählen
<div id="menu">
<ul class="year">
<li><p>Year: > 2012</p></li>
<ul>
<li><a class="year" href="#">> 2012</a></li>
<li><a class="year" href="#">> 2011</a></li>
<li><a class="year" href="#">> 2010</a></li>
<li><a class="year" href="#">> 2009</a></li>
<li><a class="year" href="#">> 2006</a></li>
</ul>
</ul>
</div>
Kann mir jemand helfen. Vielen Dank
Sunno
