【发布时间】:2011-10-26 06:24:33
【问题描述】:
我的 CSS 样式在 IE 9 中不起作用。它在 IE 8 和 Chrome 中起作用。在下面的代码样式中,cpHeader 在单独的 css 文件中定义。关于为什么 IE 9 不呈现样式的任何线索。
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h1>Welcome to the site</h1>
<div class="cpHeader">
<asp:Label ID="Label2" runat="server" Text="header text"></asp:Label>
</div> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
...
在 Site.css 中
.cpHeader
{
color: white;
background-image:url('../Images/bg_sm.png');
font: bold 11px auto "Trebuchet MS", Verdana;
font-size: 14px;
cursor: pointer;
border-style:solid;
border-bottom-style:none;
border-width:1px;
border-color:#5A5A5A;
height:18px;
padding: 4px;
text-align:left;
}
编辑:我找到了a mention of a possible problem,但不知道如何修复它。
【问题讨论】:
-
你是如何将css文件包含在aspx文件中的?
-
在 Site.master,
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" /> -
您要求我们调试前端问题,但向我们展示了后端代码的 sn-ps。这使得故障排除非常困难。
标签: asp.net css internet-explorer-9