我在彼此下方的下拉菜单中获取一些文本时遇到问题。知道如何解决吗?
这是 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;
}
这是问题的图片
任何帮助,将不胜感激
通过改变可见性修复了一些问题:隐藏;显示:无;
但是悬停时问题仍然存在