我不知道我在做什麼錯在這裏,所以你能幫助我嗎?我想創建一個級聯下拉菜單,我看不出我做錯了什麼。我已經嘗試了一切。我只是出出主意
*
這裏是我的代碼
<style type="text/css">
body {
background:#bf5c71 url('australia1.jpg');
}
.clearfix:after {
display:block;
clear:both;
}
/*----- Menu Outline -----*/
.menu-wrap {
width:100%;
box-shadow:0px 1px 3px rgba(0,0,0,0.2);
background:#3e3436;
}
.menu {
width:1000px;
margin:0px auto;
}
.menu li {
margin:0px;
list-style:none;
font-family:'Ek Mukta';
}
.menu a {
transition:all linear 0.15s;
color:#919191;
}
.menu li:hover > a, .menu .current-item > a {
text-decoration:none;
color:#be5b70;
}
.menu .arrow {
font-size:11px;
line-height:0%;
}
/*----- Top Level -----*/
.menu > ul > li {
float:left;
display:inline-block;
position:relative;
font-size:19px;
}
.menu > ul > li > a {
padding:10px 40px;
display:inline-block;
text-shadow:0px 1px 0px rgba(0,0,0,0.4);
}
.menu > ul > li:hover > a, .menu > ul > .current-item > a {
background:#2e2728;
}
/*----- Bottom Level -----*/
.menu li:hover .sub-menu,
.menu li:hover .sub-menu1{
z-index:1;
opacity:1;
}
.sub-menu {
width:160%;
padding:5px 0px;
position:absolute;
top:100%;
left:0px;
z-index:-1;
opacity:0;
transition:opacity linear 0.15s;
box-shadow:0px 2px 3px rgba(0,0,0,0.2);
background:#2e2728;
}
.sub-menu1 {
width:100%;
padding:0px 0px;
position:relative;
\t top:100%;
left:370px;
z-index:100;
opacity:50;
transition:opacity linear 0.15s;
box-shadow:0px 2px 3px rgba(0,0,0,0.2);
background:#2e2758;
\t
}
.sub-menu li,
.sub-menu1 li
{
display:block;
font-size:16px;
}
.sub-menu li a{
padding:10px 30px;
display:block;
}
.sub-menu1 li a{
\t padding:10px 10px;
display:block;
}
.sub-menu li a:hover, .sub-menu .current-item a,
.sub-menu1 li a:hover, .sub-menu1 .current-item a
{
background:#3e3436;
}
</style>
</body>
\t </html>
<html>
<head>
<title> Australia </title>
</head>
<body>
<div class="menu-wrap">
<nav class="menu">
<ul class="clearfix">
<li><a href="#">Acasa</a></li>
<li><a href="#">Obiective turistice<span class="arrow">▼</span></a>
<ul class="sub-menu">
<li><a href="#">Sydney</a>
\t \t \t \t \t \t <ul class="sub-menu1">
\t \t \t \t \t \t \t <li><a href="#">Test</a>
\t \t \t \t \t \t </ul> \t
\t \t \t \t \t </li>
<li><a href="#">Melbourne</a></li>
<li><a href="#">Brisbane</a></li>
<li><a href="#">Perth</a></li>
</ul>
</li>
\t \t \t <li class="current-item"><a href="#">Galerie Foto</a></li>
<li><a href="#">Video</a></li>
</ul>
</nav>
</div>
總是發佈的jsfiddle爲更好的解釋 – geeksal
我覺得我做@geeksal –
請更多地討論 - 什麼你的意思級聯菜單。我的意思是他們是不同類型的這種菜單,你真正想要的是哪一種? – geeksal