我有两个主要的 div
<div1>menu</div1>
<div2>searchbox</div2>
由于下面的 div2,我无法在悬停时显示子菜单;div2=div.searchcontainertop
具有绝对位置,该 div 位于悬停子菜单的顶部,这使得无法在悬停时显示子菜单
我试过,firefox,chrome,opera,IE10 - jsfiddle
如何显示子菜单?
<style type="text/css">
<!--
.searchcontainermain {
width: 100%;
position: relative;
}
.searchcontainertop {
width: 100%;
position: absolute;
left: 0px;
top: 0px;
}
.searchcontainerleft {
float: right;
width: 400px;
padding-right: 1%;
}
#nav, #nav ul {
width: 100%;
height: 28px;
list-style: none;
margin: 0;
padding: 0;
background: none;
font: 12px/28px Verdana, Arial, Helvetica, sans-serif;
}
#nav li {
float: left;
position: relative;
}
#nav li:hover, #nav li.jshover {
background-color: none;
}
#nav a {
font-weight: bold;
display: block;
color: #000;
padding: 0 19px;
text-align: center;
text-decoration: none;
border-right: 1px solid #999;
}
#nav a:hover {
color: #000;
}
#nav ul {
border: none;
border-top: 0;
border-bottom: 0;
display: none;
position: absolute;
top: 28px;
left: 0;
}
#nav ul a {
border: 0;
border-bottom: 1px solid #000;
width: 114px;
}
#nav li:hover ul, #nav li.jshover ul {
display: block;
}
-->
</style>
<div id="conteiner">
<div id="main">
<div id="menu">
<ul id="nav">
<li><a href="" target="_self">menu1</a></li>
<li><a class="active" href="" target="_self">menu2</a>
<ul>
<li><a href="" target="_self">submenu1</a></li>
<li><a href="" target="_self">submenu2</a></li>
<li><a href="" target="_self">submenu3</a></li>
<li><a href="" target="_self">submenu4</a></li>
</ul>
</li>
</ul>
</div>
<div class="searchcontainermain">
<div class="searchcontainertop">
<div class="searchcontainerleft"> some text goes here<br />
some text goes here<br />
some text goes here<br />
some text goes here<br />
some text goes here<br />
</div>
</div>
</div>
</div>
</div>