How to make active link item bold when using asp.net Menu control
-
19-06-2021 - |
Question
How to make active(selected) link item bold when using asp.net Menu control ?
Solution
You can just use the styles of the Menu
control:
<asp:Menu ID="Menu1" DataSourceID="mySiteMap" runat="server"
Orientation="Horizontal" RenderingMode="Table"
StaticSubMenuIndent="16px">
<StaticSelectedStyle Font-Bold="True" />
</asp:Menu>
This is the result:
OTHER TIPS
1 - View the HTML Source.
2 - Find the class
name or id
being used to signal an active element.
3 - Style the element appropriately using the selector found in step 2.
If the link you are after to turn bold is a level
<asp:menu id="NavigationMenu" ..............>
<levelmenuitemstyles>
<asp:menuitemstyle BackColor="LightSteelBlue" forecolor="Black"/>
</levelmenuitemstyles>
<levelselectedstyles>
<asp:menuitemstyle BackColor="Cyan" forecolor="Gray"/>
</levelselectedstyles>
</levelmenuitemstyles>
</asp:menu>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow