gpt4 book ai didi

html - 无法在父 block 旁边的单独 block 中显示子菜单

转载 作者:行者123 更新时间:2023-11-28 06:02:12 24 4
gpt4 key购买 nike

我必须创建一个嵌套菜单,但我面临的问题是子菜单仅在创建水平滚动条时显示在父菜单中(滚动到最右边你可以看到子菜单)目前我使用的CSS是

  position: relative;
list-style: none;
right: 100%;
left: auto;
padding: 10px;
width: 200px;
height: 250px;
overflow-y: scroll;
display: none;
text-align: left;
background-color: #f9f9f9;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);

https://jsfiddle.net/g0kujLqk/

最佳答案

引用此代码:

  #templatemo_menu
{
clear: both;
width: 960px;
height: 50px;
background: url(../images/templatemo_menu_bg.gif) repeat-x;
}


#templatemo_menu ul li{
text-align: center;
display: inline-block;
position: relative;
}

#templatemo_menu ul ul
{
display: none;
position:absolute;
}

#templatemo_menu ul ul ul
{
left:100%;
top :-10px;

}

#templatemo_menu ul li:hover >ul
{
display:block;
padding:0;
margin-top:5px;
}

关于html - 无法在父 block 旁边的单独 block 中显示子菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36687763/

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