gpt4 book ai didi

html - 100% 高度在下拉菜单中不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 03:56:44 25 4
gpt4 key购买 nike

实时查看- http://uposonghar.com/testsite/

当我向菜单添加更多元素时 - 菜单容器不会展开并且元素会超出菜单范围。

截图- enter image description here

代码-

<LI id=navPreretire><A title="Pre Retirement Procedures"  href="http://pencproc/" target=_blank><SPAN class=singleLine>Pre Retirement Procedures</SPAN> </A>

<!--Mega menu drop-down part1, the div have to stay like that-->
<div class="dropdown">
<!--until here-->
<Ul>
<div class="dropdown_3rd_lvl1"><li ><a href="#">Plan Benifit Payment Procedures</a>
<ul>
<li ><a href="#">Communications</a></li>
<li ><a href="#">Manage Payments</a></li>
<li ><a href="#">Manage Pension Benefits</a></li>
<li ><a href="#">Reports</a></li>
</UL></li></div>

<div class="dropdown_3rd_lvl2"><li ><a href="#">Pension Services Procedures</a>
<ul>
<li ><a href="#">Communications</a></li>
<li ><a href="#">Manage Group Benefits</a></li>
<li ><a href="#">Manage Payments</a></li>
<li ><a href="#">Manage Pension Benefits</a></li>
<li ><a href="#">Reports</a></li>
<li ><a href="#">Reports</a></li>
<li ><a href="#">Reports</a></li>
<li ><a href="#">Reports</a></li>
<li ><a href="#">Reports</a></li>
<li ><a href="#">Reports</a></li>
<li ><a href="#">Reports</a></li>
<li ><a href="#">Reports</a></li>
</UL></li></div>

</ul>
<!--Menu ends-->
</div>
<!--Menu ends-->
</LI>

CSS-

.dropdown{
display: none;
BACKGROUND-COLOR: #886d53;
clear: both;
}

.dropdown>ul>li{
clear: both;
float: left;
}

#menu li:hover .dropdown{
position: absolute;
display: block;
height:100%;
min-width: 430px;
margin: 38px auto;
padding-top: 5px;
}

.dropdown ul li{
clear: both;
}

#menu .dropdown ul li:hover{
clear: both;
}

最佳答案

删除不必要的heightposition:absolute

#menu li:hover .dropdown {
/*height: 200px;*/
}
#menu ul ul {
height: auto;
}
.dropdown_3rd_lvl1 {
/*position: absolute;*/
/*left: 0*/
/*margin-left: -30px;*/
float: left;
}
.dropdown_3rd_lvl2 {
/*position: absolute;*/
/*margin-left: 170px;*/
float: left;
}

关于html - 100% 高度在下拉菜单中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22688089/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com