简体   繁体   English

水平列表项中的面板显示在按钮后面

[英]Panel in Horizontal List item showing behind Button

On my Master page, I have created a Horizontal menu, styled by CSS. 在我的母版页上,我创建了一个由CSS样式的Horizo​​ntal菜单。 The list items show panels with link buttons on them to take users to different pages. 列表项显示面板上带有链接按钮的面板,以将用户带到不同页面。

The Panels always show above controls, except for one page. 除一页外,面板始终显示以上控件。
The content of the page shows 2 asp:Buttons. 该页面的内容显示2个asp:Buttons。 On this page, the panel gets hidden behind the buttons, but the border for the panel still shows. 在此页面上,面板隐藏在按钮后面,但是面板的边框仍然显示。

The image below will illustrate clearly: 下图将清楚地说明:
证据

The CSS for the horizontal menu is as follows: 水平菜单的CSS如下:

/* Horizontal menue style */
ul 
{

    padding: 0;
    margin: 0 0 0 0 ;
    list-style: none;
}

li 
{
    cursor: default;
    float: left;
    position: relative;
    width: 90px;
    color: darkgray;
    text-align: center;
    background-color: white;
    height: 23px;
    padding-top: 2px;
}

li:hover {
    background-color: white;
    color: black;
    padding-top: 2px;
}

li ul 
{

    display: none;
    position: absolute;
    margin: 0;
    padding: 0;
    margin-top: -9px;
    width: 100px;
}

li > ul 
{

    top: auto;
    left: auto;
}

li:hover ul, li.over ul
{
    display: block;
}

The panel goes through a skin file: 面板通过外观文件:
<asp:Panel runat="server" CssClass="menuWrapper" SkinID="MenuWrapper"></asp:Panel>

.menuWrapper 
{
    z-index: 500;
    font-size: small;
    margin-top: 15px;
    margin-left: -2px;
    padding: 5px;
    padding-left: 15px;
    line-height: 25px;
    background-color: white;
    width: 190px;
    text-align: left;
    border-left: 1px lightgray solid;
    border-bottom: 1px lightgray solid;
    border-right: 1px lightgray solid;
    border-top-right-radius: 5px 5px;
    border-bottom-right-radius: 5px 5px;
    border-bottom-left-radius: 5px 5px;
}

Ive even fiddles with the z-index. Ive甚至在摆弄z-index。 How can I create a solution. 如何创建解决方案。

The answer lies in the z-index of the UL. 答案在于UL的z-index。 I have changed the UL css to the following: 我已将UL css更改为以下内容:

ul 
{

    padding: 0;
    margin: 0 0 0 0 ;
    list-style: none;
    z-index: 499;
}

Which has now fixed the issue. 现在已经解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM