1

如何更改我的 asp:menu 的字体颜色以从站点地图中读取项目?
ccsClass 没用!
这是我的代码:

<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" >

这是 ccsClass:

.MyMenu{color:White; font-family:Tahoma; font-size:medium;}  

谢谢

4

2 回答 2

1

您可以通过前景色添加颜色,也可以添加样式

 <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" >
于 2012-08-27T08:59:18.693 回答
0

为每个操作定义一个类,asp:Menu如下所示:

<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"/> 

现在您可以在定义的类中为任何子菜单或链接提供格式。

于 2012-08-27T08:57:43.820 回答