How to get rid of ugly asp:Menu flickering?

后端 未结 12 1216
遥遥无期
遥遥无期 2020-12-24 14:37

I\'m using the asp:Menu control on an ASP.NET 4.0 Webforms page with table-free rendering mode:



        
12条回答
  •  醉酒成梦
    2020-12-24 15:15

    The above solution was close, but did not work for me. It required the slight modification below in order to fix the problem being described. When I create a new ASP.NET web forms application project using Visual Studio 2010, the CSS that is generated for the menu by default makes use of ".menu" (CSS classes) to apply style rather than "#menu" (an element with ID of "menu").

    #menu - does not work

    .menu - does work

    So, in other words, put this into your CSS file near the bottom:

    .menu ul li ul
    {
        display: none;
    }
    
    .menu ul li 
    {
        position: relative; 
        float: left;
        list-style: none;
    }
    

提交回复
热议问题