我正在开发和 asp.net Web 应用程序。在该应用程序中,我使用 asp 菜单控件并将 css 类应用于该菜单控件。当我调试项目时,Css 工作正常。但是在虚拟主机帐户上发布和上传后。它没有显示css效果。
我的 CSS 课
.primaryStaticMenu
{
background-color: Transparent;
border:solid #D1FCFF 1px;
font-family :verdana , verdana_font;
font-size:inherit;
color:red;
}
.primaryStaticMenuItem
{
width: 8em;
border-right: 2px solid #FFFFFF;
padding: 0.2em 0 0.2em 0.2em;
font-family: verdana, verdana_font;
font-size: inherit;
height: 25px;
color: inherit;
background-color: #78B7EF;
}
.primaryStaticHover
{
color: #800000;
border: 1px solid #74C4C1;
background-color: #9AC47D;
}
.primaryDynamicMenu
{
width: 18em;
border: 1px solid #D1FCFF;
font-family: verdana, verdana_font;
font-size: inherit;
color: Red;
background-color: #78B7EF;
}
.primaryDynamicMenuItem
{
width: 18em;
height:1.8em;
padding: 0.5em 0 0.5em 1em;
border: 1px solid #D1FCFF;
font-family: verdana, verdana_font;
font-size: inherit;
color: Red;
background-color: #78B7EF;
}
.primaryDynamicHover
{
font-family :verdana , verdana_font;
font-size:inherit;
color:#AD0000;
border: 1px solid #74C4C1;
background-color: #9AC47D;
}
Asp 菜单控制
<asp:Menu id="menuPrimary" runat="server" DataSourceID="xmlDataSource" Orientation="Horizontal"
StaticEnableDefaultPopOutImage="false" StaticDisplayLevels="1"
MaximumDynamicDisplayLevels="5" CssClass="MyMenu">
<DataBindings>
<asp:MenuItemBinding DataMember="MenuItem" ValueField="Tag"
NavigateUrlField="NavigateUrl" TargetField="TestTarget"
TextField="Text" ToolTipField="ToolTip" />
</DataBindings>
<StaticMenuStyle CssClass="primaryStaticMenu"/>
<StaticMenuItemStyle CssClass="primaryStaticMenuItem"/>
<StaticHoverStyle CssClass="primaryStaticHover"/>
<DynamicMenuStyle CssClass="primaryDynamicMenu" />
<DynamicMenuItemStyle CssClass="primaryDynamicMenuItem"/>
<DynamicHoverStyle CssClass="primaryDynamicHover"/>
</asp:Menu>