How to style an asp.net menu with CSS

前端 未结 11 1235
囚心锁ツ
囚心锁ツ 2020-11-30 00:36

I\'m in the process of styling an asp.net menu and I\'m trying to understand the meaning of the StaticSelectedStyle-CssClass and StaticHoverStyle-CssClass parameters.

<
11条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 01:33

    I ran into the issue where the class of 'selected' wasn't being added to my menu item. Turns out that you can't have a NavigateUrl on it for whatever reason.

    Once I removed the NavigateUrl it applied the 'selected' css class to the a tag and I was able to apply the background style with:

    div.menu ul li a.static.selected
    {
        background-color: #bfcbd6 !important;
        color: #465c71 !important;
        text-decoration: none !important;
    }
    

提交回复
热议问题