我想設置這個2列菜單,並列與每個列子菜單打開到不同的一面。左側菜單正常工作,子菜單按鈕可點擊,但右側菜單子菜單項位於左側菜單元素下。我嘗試使用z-index,它工作,但使左菜單項不可點擊(懸停也沒有工作)。請參閱http://kink.cz/najforever/index_copy.html以供參考。 你能否建議我如何能正確顯示正確的菜單子菜單項? 非常感謝您的幫助。CSS子菜單覆蓋問題
HTML:
<div class='people'>
<div id='cssmenu'>
<ul>
<li class='active has-sub' id='fake'><a href='#'><span>A fake artist</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Blog</span></a></li>
<li class='has-sub'><a href='#'><span>Facebook</span></a></li>
<li class='has-sub'><a href='#'><span>Instagram</span></a></li>
</ul>
</li>
<li class='active has-sub' id='danny'><a href='#'><span>Danny Rose Fashion</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Blog</span></a></li>
<li class='has-sub'><a href='#'><span>Facebook</span></a></li>
<li class='has-sub'><a href='#'><span>Instagram</span></a></li>
</ul>
</li>
<li class='active has-sub' id='heels'><a href='#'><span>Heels in Prague</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Blog</span></a></li>
<li class='has-sub'><a href='#'><span>Facebook</span></a></li>
<li class='has-sub'><a href='#'><span>Instagram</span></a></li>
</ul>
</li>
<li class='active has-sub' id='hodanajan'><a href='#'><span>Hodanajan</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Blog</span></a></li>
<li class='has-sub'><a href='#'><span>Facebook</span></a></li>
<li class='has-sub'><a href='#'><span>Instagram</span></a></li>
</ul>
</li>
<li class='active has-sub' id='jakub'><a href='#'><span>Jakub Mařík</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Web</span></a></li>
<li class='has-sub'><a href='#'><span>Facebook</span></a></li>
<li class='has-sub'><a href='#'><span>Instagram</span></a></li>
</ul>
</li>
</ul>
</div>
<div id='cssmenu2'>
<ul>
<li class='active has-sub' id='kaa'><a href='#'><span>Kaa Glo</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Blog</span></a></li>
<li class='has-sub'><a href='#'><span>Facebook</span></a></li>
<li class='has-sub'><a href='#'><span>Instagram</span></a></li>
</ul>
</li>
<li class='active has-sub' id='pau'><a href='#'><span>Paulinemma</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Blog</span></a></li>
<li class='has-sub'><a href='#'><span>Facebook</span></a></li>
<li class='has-sub'><a href='#'><span>Instagram</span></a></li>
</ul>
</li>
<li class='active has-sub' id='red'><a href='#'><span>Red Poppy Stories</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Blog</span></a></li>
<li class='has-sub'><a href='#'><span>Facebook</span></a></li>
<li class='has-sub'><a href='#'><span>Instagram</span></a></li>
</ul>
</li>
<li class='active has-sub' id='kisic'><a href='#'>Sandra Kisic</a>
<ul>
<li class='has-sub'><a href='#'><span>Blog</span></a></li>
<li class='has-sub'><a href='#'><span>Facebook</span></a></li>
<li class='has-sub'><a href='#'><span>Instagram</span></a></li>
</ul>
</li>
<li class='active has-sub' id='aesthet'><a href='#'><span>The Aesthet</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Blog</span></a></li>
<li class='has-sub'><a href='#'><span>Facebook</span></a></li>
<li class='has-sub'><a href='#'><span>Instagram</span></a></li>
</ul>
</li>
</ul>
</div>
CSS:
/* ===========================
====== Name Menu Right ======
=========================== */
#cssmenu {
padding: 0;
margin: 0;
border: 0;
line-height: 1;
text-align:left
}
#cssmenu ul,
#cssmenu ul li,
#cssmenu ul ul {
list-style: none;
margin: 0;
padding: 0;
}
#cssmenu ul {
position: relative;
z-index: 597;
float: left;
}
#cssmenu ul li {
float: left;
min-height: 1px;
line-height: 1em;
vertical-align: middle;
position: relative;
}
#cssmenu ul li.hover,
#cssmenu ul li:hover {
position: relative;
z-index: 599;
cursor: default;
}
#cssmenu ul ul {
visibility: hidden;
position: absolute;
top: 100%;
left: 200px;
z-index: 598;
}
#cssmenu ul ul li {
float: none;
right:250px;
}
#cssmenu ul ul ul {
top: -2px;
right: 0;
}
#cssmenu ul li:hover > ul {
visibility: visible;
}
#cssmenu ul ul {
top: 1px;
left: 99%;
}
#cssmenu ul li {
float: none;
}
#cssmenu ul ul {
margin-top: 1px;
}
#cssmenu ul ul li {
font-weight: normal;
}
/* Custom CSS Styles Menu Right*/
#cssmenu {
width: 130px;
background: white;
font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif;
zoom: 1;
font-size: 12px;
float:right;
margin-left:5px;
}
#cssmenu:before {
content: '';
display: block;
}
#cssmenu:after {
content: '';
display: table;
clear: both;
}
#cssmenu a {
display: block;
padding: 6px 0px;
color: black;
text-decoration: none;
padding-right:5px;
}
#cssmenu > ul {
width: 130px;
}
#cssmenu ul ul {
width: 130px;
}
#cssmenu > ul > li > a {
color: black;
}
#cssmenu > ul > li > a:hover {
color: black;
}
#cssmenu > ul > li.active a {
background: white;
}
#cssmenu > ul > li a:hover,
#cssmenu > ul > li:hover a {
background: white;
}
#cssmenu li {
position: relative;
}
#cssmenu ul ul li.first {
-webkit-border-radius: 0 3px 0 0;
-moz-border-radius: 0 3px 0 0;
border-radius: 0 3px 0 0;
}
#cssmenu ul ul li.last {
-webkit-border-radius: 0 0 3px 0;
-moz-border-radius: 0 0 3px 0;
border-radius: 0 0 3px 0;
border-bottom: 0;
}
#cssmenu ul ul {
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
#cssmenu ul ul {
margin-left:2px;
text-align:right;
}
#cssmenu ul ul a {
font-size: 12px;
color: black;
}
#cssmenu ul ul a:hover {
color: black;
}
#cssmenu ul ul li {
}
#cssmenu ul ul li:hover > a {
background: black;
color: #ffffff;
}
#cssmenu.align-right > ul > li > a {
border-left: 4px solid black;
border-right: none;
}
#cssmenu.align-right {
float: right;
}
#cssmenu.align-right li {
text-align: right;
}
#cssmenu.align-right ul li.has-sub > a:after {
content: none;
}
#cssmenu.align-right ul ul {
visibility: hidden;
position: absolute;
top: 0;
left: -100%;
z-index: 598;
width: 100%;
}
#cssmenu.align-right ul ul li.first {
-webkit-border-radius: 3px 0 0 0;
-moz-border-radius: 3px 0 0 0;
border-radius: 3px 0 0 0;
}
#cssmenu.align-right ul ul li.last {
-webkit-border-radius: 0 0 0 3px;
-moz-border-radius: 0 0 0 3px;
border-radius: 0 0 0 3px;
}
#cssmenu.align-right ul ul {
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
/* ===========================
====== Name Menu Left ======
=========================== */
#cssmenu2 {
padding: 0;
margin: 0;
border: 0;
line-height: 1;
text-align:right;
}
#cssmenu2 ul,
#cssmenu2 ul li,
#cssmenu2 ul ul {
list-style: none;
margin: 0;
padding: 0;
}
#cssmenu2 ul {
position: relative;
z-index: 597;
float: left;
}
#cssmenu2 ul li {
float: left;
min-height: 1px;
line-height: 1em;
vertical-align: middle;
position: relative;
}
#cssmenu2 ul li.hover,
#cssmenu2 ul li:hover {
position: relative;
z-index: 599;
cursor: default;
}
#cssmenu2 ul ul {
visibility: hidden;
position: absolute;
top: 100%;
left: 0px;
z-index: 598;
width: 100%;
text-align:left;
}
#cssmenu2 ul ul li {
float: none;
margin-left:4px;
}
#cssmenu2 ul ul ul {
top: -2px;
right: 0;
}
#cssmenu2 ul li:hover > ul {
visibility: visible;
}
#cssmenu2 ul ul {
top: 1px;
left: 99%;
}
#cssmenu2 ul li {
float: none;
}
#cssmenu2 ul ul {
margin-top: 1px;
}
#cssmenu2 ul ul li {
font-weight: normal;
}
/* Custom CSS Styles Menu Left*/
#cssmenu2 {
width: 130px;
background: white;
font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif;
zoom: 1;
font-size: 12px;
float:right;
margin-left:5px;
}
#cssmenu2:before {
content: '';
display: block;
}
#cssmenu2:after {
content: '';
display: table;
clear: both;
}
#cssmenu2 a {
display: block;
padding: 6px 0px;
color: black;
text-decoration: none;
padding-right:5px;
}
#cssmenu2 > ul {
width: 130px;
}
#cssmenu2 ul ul {
width: 130px;
}
#cssmenu2 > ul > li > a {
border-right: 4px solid black;
color: black;
}
#cssmenu2 > ul > li > a:hover {
color: black;
}
#cssmenu2 > ul > li.active a {
background: white;
}
#cssmenu2 > ul > li a:hover,
#cssmenu2 > ul > li:hover a {
background: white;
}
#cssmenu2 li {
position: relative;
}
#cssmenu2 ul ul li.first {
-webkit-border-radius: 0 3px 0 0;
-moz-border-radius: 0 3px 0 0;
border-radius: 0 3px 0 0;
}
#cssmenu2 ul ul li.last {
-webkit-border-radius: 0 0 3px 0;
-moz-border-radius: 0 0 3px 0;
border-radius: 0 0 3px 0;
border-bottom: 0;
}
#cssmenu2 ul ul {
border-right: 2px solid black;
background:white;
margin-top:-2px;
}
#cssmenu2 ul ul {
margin-left:2px;
}
#cssmenu2 ul ul a {
font-size: 12px;
color: black;
}
#cssmenu2 ul ul a:hover {
color: black;
}
#cssmenu2 ul ul li {
}
#cssmenu2 ul ul li:hover > a {
background: black;
color: #ffffff;
}
#cssmenu2.align-right > ul > li > a {
border-left: 4px solid black;
border-right: none;
}
#cssmenu2.align-right {
float: right;
}
#cssmenu2.align-right li {
text-align: right;
}
#cssmenu2.align-right ul li.has-sub > a:after {
content: none;
}
#cssmenu2.align-right ul ul {
visibility: hidden;
position: absolute;
top: 0;
left: -100%;
z-index: 598;
width: 100%;
}
#cssmenu2.align-right ul ul li.first {
-webkit-border-radius: 3px 0 0 0;
-moz-border-radius: 3px 0 0 0;
border-radius: 3px 0 0 0;
}
#cssmenu2.align-right ul ul li.last {
-webkit-border-radius: 0 0 0 3px;
-moz-border-radius: 0 0 0 3px;
border-radius: 0 0 0 3px;
}
#cssmenu2.align-right ul ul {
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
/* ===========================
====== Contact Form ======
=========================== */
input, textarea {
padding: 10px;
border: 1px solid #E5E5E5;
width: 400px;
color: #999999;
box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;
-webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;
}
textarea {
width: 400px;
height: 150px;
max-width: 400px;
line-height: 18px;
}
input:hover, textarea:hover,
input:focus, textarea:focus {
border-color: 1px solid #C9C9C9;
box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px;
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px;
}
.form label {
color: #999999;
}
/* Submit Button */
.submit input {
width: 100px;
height: 40px;
background-color: #474E69;
color: #FFF;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
非常感謝!很棒。 –