gpt4 book ai didi

c# - jQuery DropDown间距问题

转载 作者:太空宇宙 更新时间:2023-11-04 05:04:37 24 4
gpt4 key购买 nike

我在下拉菜单中获取一些文本时遇到问题。知道如何解决吗?

这是 HTML 和 C#

<ul class="dropdown">
<li>
<p class="MenuOverskrift">
<a href="#">Produkter</a>
</p>

<ul>
<asp:Label ID="lbl_Standard_Panel" runat="server" Text="" />
</ul>
</li>
</ul>

string standard_Menu = "";

foreach (Products group in Products.GetEvereGroup(connection))
{
standard_Menu += "<li>" +
"<p>" +
group.GroupName +
"</p>" +
"<ul>";

foreach (Products product in Products.GetProductsByGroup(group.GroupID, connection))
{
standard_Menu += "<li>" +
"<p>" +
"<a href=\"_" + product.Link + "\">" + product.ProductName + "</a>" +
"</p>" +
"</li>";
}

standard_Menu += "</ul>" +
"</li>";

lbl_Standard_Panel.Text = standard_Menu;
}

这是CSS

#Menu_Standard
{
position: relative;
left: 550px;
width: 100px;
}
#Menu_Standard ul li ul li p
{
color: #9c8b5c;
}
#Menu_Standard ul ul ul
{
right: 100px;
}
#Menu_Standard ul li ul li a
{
color: #9c8b5c;
text-decoration: none;
font-size: medium;
}
#Menu_Standard a
{
color: #9c8b5c;
text-decoration: none;
font-size: x-large;
}

ul.dropdown ul
{
visibility: hidden;
position:relative;
z-index:1;
width: auto;
}

ul.dropdown li:hover > ul
{
visibility: visible;
background-color: #373741;
filter:alpha(opacity=60);
border-radius: 15px;
padding: 5px;
}

这是问题的图片 enter image description here

任何帮助将不胜感激

通过更改可见性修复了一些问题:隐藏;显示:无;

但悬停时问题仍然存在 enter image description here

最佳答案

当为元素设置了 visibility: hidden 属性时,该元素的不透明度为 0,请改用 display: none

关于c# - jQuery DropDown间距问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10707910/

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