how to change fontcolor of asp:menu that read items from sitemap
Question
how can i change my fontcolor of asp:menu that it read items from sitemap?
ccsClass not worked on it!
this is my code:
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1"
StaticDisplayLevels="2" CssClass="MyMenu"
StaticSubMenuIndent="18px"
DynamicMenuItemStyle-BackColor="#C0C0BC"
DynamicHoverStyle-BackColor="#B3B3B3"
StaticHoverStyle-BackColor="#666666"
StaticHoverStyle-ForeColor="#d9d9d6"
StaticMenuItemStyle-VerticalPadding="1px" StaticPopOutImageUrl="~/Images/control_rewind_blue.png" >
this is ccsClass:
.MyMenu{color:White; font-family:Tahoma; font-size:medium;}
thanks
Solution
You can add color by forecolor and you can add style as well
<asp:Menu ID="Menu1" ForeColor="#003399" style="left: 40px; position: relative; top: 6px" runat="server" DataSourceID="SiteMapDataSource1"
StaticDisplayLevels="2" CssClass="MyMenu"
StaticSubMenuIndent="18px"
DynamicMenuItemStyle-BackColor="#C0C0BC"
DynamicHoverStyle-BackColor="#B3B3B3"
StaticHoverStyle-BackColor="#666666"
StaticHoverStyle-ForeColor="#d9d9d6"
StaticMenuItemStyle-VerticalPadding="1px" StaticPopOutImageUrl="~/Images/control_rewind_blue.png" >
OTHER TIPS
Define a class for every operation on asp:Menu
like this :
<asp:Menu ID="AspMenu" runat="server">
<StaticMenuStyle CssClass="VerticalMenuli" />
<StaticMenuItemStyle CssClass="VerticalMenuItem" />
<StaticHoverStyle CssClass="VerticalMenuHover" />
<StaticSelectedStyle CssClass="VerticalMenuSelectedItem" />
<DynamicMenuStyle CssClass="VerticalMenuSubMenu" />
<DynamicMenuItemStyle CssClass="VerticalMenuSubMenuItem" />
<DynamicHoverStyle CssClass="VerticalSubMenuHover" />
<DynamicSelectedStyle CssClass="SubMenuSelected"/>
And now you can give formatting in the defined class for any sub menu or link.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow