我有这个嵌套菜单,其中一切正常,期望从第三层次结构。
我在这里有代码和结果:http://jsfiddle.net/wvsL9/
如果您将鼠标悬停在菜单上:“PRODUKTER”然后是“PRIVAT”,您会看到宽度不是“自动”的问题。 我真的被困在这里,我尝试了很多变化。 你能找到它为什么不能按我的意愿工作吗?
提前致谢
#menu, #menu ul {
margin: 0;
padding: 0;
list-style: none;
font-size: 0.9em;
font-family:'Helvetica Neue For BBC W01 Bd';
}
#menu:before,
#menu:after {
content: "";
display: table;
}
#menu:after {
clear: both;
}
#menu {
zoom:1;
}
#menu li {
float: left;
display: inline-block;
position: relative;
}
#menu li:last-child {
border: 0;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
#menu a {
display: inline-block;
padding: 50px 8px;
color: #000;
text-transform: uppercase;
text-decoration: none;
font-weight: bold;
}
#menu li:hover > a {
background: #000;
color: #fff;
}
#menu li.current-menu-item a{
background: #000;
color: #FFF;
}
*html #menu li a:hover { /* IE6 only */
color: #fafafa;
}
#menu ul {
margin: 20px 0 0 0;
_margin: 0; /*IE6 only*/
opacity: 0;
visibility: hidden;
position: absolute;
width: 100%;
top: 120px;
left: 0;
z-index: 1;
background: #000;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-ms-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
#menu li:hover > ul {
opacity: 1;
visibility: visible;
margin: 0;
}
#menu ul li {
position: static;
float: none;
display: block;
border: 0;
_line-height: 0; /*IE6 only*/
}
#menu ul li:last-child {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
#menu ul a {
padding-top: 10px;
padding-bottom: 10px;
_height: 10px; /*IE6 only*/
display: block;
white-space: nowrap;
float: none;
text-transform: none;
color: #fff;
}
#menu ul a:hover {
background-color: #f60c0c;
}
#menu ul li:first-child > a {
-moz-border-radius: 3px 3px 0 0;
-webkit-border-radius: 3px 3px 0 0;
border-radius: 3px 3px 0 0;
}
#menu ul li:first-child > a:after {
content: '';
position: absolute;
left: 40px;
top: -6px;
}
#menu ul ul {
top: 0;
left: 100%;
margin: 0 0 0 20px;
_margin: 0; /*IE6 only*/
}
#menu ul ul li{
display: block;
width: auto;
float: none;
}
#menu ul ul li a{
display: block;
padding: 10px 50px;
}
#menu ul ul li:first-child a:after {
left: -6px;
top: 50%;
margin-top: -6px;
border-left: 0;
}
#menu ul li:first-child a:hover:after {
border-bottom-color: #04acec;
}
#menu ul ul li:first-child a:hover:after {
border-right-color: #0299d3;
border-bottom-color: transparent;
}
#menu ul li:last-child > a {
-moz-border-radius: 0 0 3px 3px;
-webkit-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
}
答案 0 :(得分:1)
答案 1 :(得分:0)