我有一些 css,当我的 CSS 文件内时,这些 css 不会应用于 Visual Studio 中的设计器,但会在我发布时应用于页面。这个问题大大减慢了网站开发速度,因为我正在尝试学习 CSS...
下面是 CSS 的示例:
.header {
background-color: #ccc;
border-bottom: 1px solid #666;
color: #222;
display: block;
font-size: 20px;
font-weight: bold;
padding: 100px 100px 100px 100px;
text-align: center;
text-decoration: none;
text-shadow: 0px 1px 0px #fff;
background-image: -webkit-gradient(linear, left top, left bottom,
from(#ccc), to(#999));
}
我在页面上应用CSS:
<header>
<asp:Label ID="lblQuestion" runat="server" Font-Bold="True" Font-Size="16pt" Text="Your question goes here..." CssClass="header"></asp:Label>
</header>
我将 CSS 添加到页面:
<link rel="stylesheet" type="text/css" href="mycss.css" media="only screen and (max-width: 480px)" />
我对 CSS 还很陌生,所以我希望有人能告诉我我正在做什么,以阻止 Visual Studio 在设计器中正确渲染 CSS...
另外,如果我将 CSS 标签直接放在页面中,那么它就可以工作,但我宁愿将 CSS 保留在它自己的文件中,以便可以重用。
工作风格示例:
<style>
.header {
background-color: #ccc;
border-bottom: 1px solid #666;
color: #222;
display: block;
font-size: 20px;
font-weight: bold;
padding: 100px 100px 100px 100px;
text-align: center;
text-decoration: none;
text-shadow: 0px 1px 0px #fff;
background-image: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#999));
}
</style>
Thanks