gpt4 book ai didi

html - 下拉菜单向右拉

转载 作者:行者123 更新时间:2023-11-28 06:00:45 25 4
gpt4 key购买 nike

你好,我一直在为我的社区和我的新论坛积极编写 phpbb 的新菜单,我只有一个问题,它非常困扰我,我遇到的问题是当我设置所有代码时它工作正常然后当我添加了另一个下拉菜单,它开始很好地做到这一点......

[.navbar2   {
position: absolute; /* Ensures that the menu doesn’t affect other elements */
border-radius: 4px 0;
}
.navbar2 li {
left: auto;
display: inline;
padding: 0 5px;
float: left; /* This lines up the menu items horizontally */
list-style: none; /* Removes the default styling (bullets) for the list */
}
.navbar2 li ul {
position: absolute;
z-index: 100;
display: none; /* Hides the drop-down menu */
color: #565656;
min-width: 150px;
max-height: 1000px;
border-radius: 4px 0;
}
.navbar2 li ul li {
background-color: #fff;
min-width: 150px;
padding: 0 5px 0 20px;
}
.navbar2 li:hover ul {
display: block; /* Displays the drop-down box when the menu item is hovered over */
border-radius: 4px;
}

/*NAV 3*/

.navbar3 {
border-radius: 4px 0;
}
.navbar3 li {
display: inline-block;
list-style: none; /* Removes the default styling (bullets) for the list */
}
.navbar3 li ul {
position: absolute;
z-index: 100;
min-width: 150px;
display: none; /* Hides the drop-down menu */
color: #565656;
float:right;
margin-left:2px;
}
.navbar3 ul li {
background-color: #fff;
min-width: 150px;
padding: 0 5px 0 20px;
}
.navbar3 li:hover ul {
display: block; /* Displays the drop-down box when the menu item is hovered over */
border-radius: 4px;
margin-left:-10px;
float:right;
margin-left:2px;
}]

dropdown bug 1

dropdown bug 2

最佳答案

在填充了一些 float 代码之后:我发现了问题,我已经全部修复了

此处提供的代码..

.navbar2    {
position: absolute; /* Ensures that the menu doesn’t affect other elements */
border-radius: 4px 0;
}
.navbar2 li {
left: auto;
padding: 0 5px;
list-style: none; /* Removes the default styling (bullets) for the list */
}
.navbar2 li ul {
position: absolute;
z-index: 100;
display: none; /* Hides the drop-down menu */
color: #565656;
min-width: 150px;
max-height: 1000px;
border-radius: 4px 0;
}
.navbar2 li ul li {
background-color: #fff;
min-width: 150px;
}
.navbar2 li:hover ul {
display: block; /* Displays the drop-down box when the menu item is hovered over */
border-radius: 4px;
margin-left:-10px;
float:right;
margin-left:2px;
}

/*NAV 3*/

.navbar3 {
border-radius: 4px 0;
}
.navbar3 li {
list-style: none; /* Removes the default styling (bullets) for the list */
}
.navbar3 li ul {
position: absolute;
z-index: 100;
min-width: 150px;
display: none; /* Hides the drop-down menu */
color: #565656;
float:right;
margin-left:2px;
}
.navbar3 ul li {
background-color: #fff;
min-width: 150px;
padding: 0 5px 0 20px;
}
.navbar3 li:hover ul {
display: block; /* Displays the drop-down box when the menu item is hovered over */
border-radius: 4px;
margin-left:-10px;
float:right;
margin-left:2px;
}

关于html - 下拉菜单向右拉,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36775104/

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