0
我有下面的代碼,我用來創建一個asp.net菜單。我已將CssClass分配給每個動態項目並創建了特定的類。但是,dynamicHoverStyle類不生效。有誰知道這是爲什麼?使用Css與Asp.net菜單(HoverStyle不生效)
<asp:Menu ID="Menu1" StaticEnableDefaultPopOutImage="false" runat="server" BackColor="#B5C7DE" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284E98" Orientation="
<DynamicHoverStyle CssClass="style1_hover"/>
<DynamicMenuStyle CssClass="style2" />
<DynamicMenuItemStyle CssClass="style1" />
<DynamicSelectedStyle BackColor="#507CD1" />
<Items>
<asp:MenuItem Text="Menu A" Value="Menu A">
<asp:MenuItem Text="Submenu A" Value="Submenu A"></asp:MenuItem>
<asp:MenuItem Text="Submenu B" Value="Submenu B"></asp:MenuItem>
<asp:MenuItem Text="Submenu C" Value="Submenu C"></asp:MenuItem>
</Items>
<StaticHoverStyle />
<StaticMenuItemStyle BorderColor="Green" BorderWidth="1px" VerticalPadding="8px" />
<StaticSelectedStyle BackColor="#507CD1" />
.style1 {
background-color:white;
border-color:black;
border:solid;
border-width:1px;
padding-left:20px;
padding-right:20px;
padding-top:10px;
padding-bottom:10px;
}
.style2 {
background-color:blue;
border-color:black;
border:solid;
border-width:1px;
padding-left:20px;
padding-right:20px;
padding-top:10px;
padding-bottom:10px;
}
.style1_hover {
background-color:blue;
border-color:black;
border:solid;
border-width:1px;
padding-left:20px;
padding-right:20px;
padding-top:10px;
padding-bottom:10px;
font-size:large;
}
你有一個獲取輸出的html代碼片段嗎? –