Danke dir. Eine Lösung per Javascript habe ich mir auch schon überlegt, ich wollte aber weitgehend ohne Javascript arbeiten.
Der HTML-Code für das Menü ist hier (nur ein kleiner Auszug):
[HTML]
[/HTML]
Wem das bekannt vorkommen sollte: Ja, es wird ein Joomla!-Backend-Template.
Der komplette CSS-Code für das Menü:
/* -------------- MENU -------------- */
#c-menu{
position: absolute;
word-wrap: break-word;
width: 100%;
top: 50px;
}
#c-menu ul{
list-style: none;
margin: 0;
padding: 0;
width: 100%;
}
#c-menu>ul>li{
height: 25px;
width: 100px;
float: left;
border: 1px solid #555;
border-radius: 5px 5px 0 0;
text-align: center;
background: #fff;
padding: 5px;
margin: 5px 10px 0;
box-sizing: border-box;
-moz-box-sizing: border-box;
background:-moz-linear-gradient(bottom, #ddd, #aaa); /* Firefox */
background:-webkit-gradient(linear, left bottom, left top, from(#ddd), to(#aaa)); /* Safari, Chrome */
background:-webkit-linear-gradient(bottom, #ddd, #aaa); /* Safari, Chrome (new syntax) */
background:-o-linear-gradient(bottom, #ddd, #aaa); /* Opera */
background:-ms-linear-gradient(bottom, #ddd, #aaa); /* IE */
background:linear-gradient(bottom, #ddd, #aaa); /* W3C Standard */
box-shadow: 2px -2px 5px -1px #444;
}
#c-menu>ul>li:hover, #c-menu>ul>li.active{
height: 30px;
margin-top: 0;
padding-top: 10px;
background:-moz-linear-gradient(top, #fff, #ddd); /* Firefox */
background:-webkit-gradient(linear, left top, left bottom, from(#fff), to(#ddd)); /* Safari, Chrome */
background:-webkit-linear-gradient(top, #fff, #ddd); /* Safari, Chrome (new syntax) */
background:-o-linear-gradient(top, #fff, #ddd); /* Opera */
background:-ms-linear-gradient(top, #fff, #ddd); /* IE */
background:linear-gradient(top, #fff, #ddd); /* W3C Standard */
box-shadow: 3px -4px 5px 1px #444;
}
#c-menu>ul>li>ul{
width: 100%;
height: 0;
background: #ddd;
position: absolute;
left: 0;
margin-top: 4px;
border-bottom: 1px solid #444;
height: 0;
overflow-y: hidden;
transition: height 1s ease;
-moz-transition-property: height, overflow-y;
-moz-transition-duration: 1s, 0.1s;
-moz-transition-timing-function: ease, linear;
-moz-transition-delay: 0, 1s;
-webkit-transition: height 1s ease;
-o-transition: height 1s ease;
}
#c-menu>ul>li:hover>ul, #c-menu>ul>li.active>ul{
height: 25px;
overflow-y: visible;
}
#c-menu>ul>li>ul>li{
height: 25px;
min-width: 100px;
float: left;
background: #bbb;
border-style: outset;
border-color: #555;
border-width: 3px;
box-sizing: border-box;
-moz-box-sizing: border-box;
margin: 0 5px;
padding: 0 5px;
}
#c-menu>ul>li>ul>li>a{
padding-left: 16px;
}
#c-menu>ul>li>ul>li a{
color: #000;
text-decoration: none;
display: block;
}
#c-menu>ul>li>ul>li:hover{
background: #ddd;
border-style: inset;
}
#c-menu>ul>li>ul>li.separator{
display: none;
}
#c-menu>ul>li>ul>li>ul{
height: 0;
padding-top: 8px;
transition: height 1s ease;
-moz-transition: height 1s ease;
-webkit-transition: height 1s ease;
-o-transition: height 1s ease;
}
#c-menu>ul>li>ul>li:hover>ul{
height: auto;
}
#c-menu>ul>li>ul>li>ul>li{
background: #bbb;
border-style: solid;
border-color: #333;
border-width: 0 1px;
}
#c-menu>ul>li>ul>li>ul>li:hover{
background: #ddd;
}
#c-menu>ul>li>ul>li>ul>li:last-child{
border-bottom: 1px solid #333;
border-radius: 0 0 3px 3px;
}