我是 html/css/asp.net 的新手所以请多多包涵..
我有 HTML 代码可以在表格上显示我的自定义样式:
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 0px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) { background-color: #dddddd; }
</style>
</head>
<table>
<tr>
<td>Deltavista</td>
<td>
<Button>Download</Button>
</td>
</tr>
</table>
这是在默认的 asp.net mvc 页面中使用的。在 _Layout.cshtml 中,样式以这种方式包含:
@Styles.Render("~/Content/css")
BundleConfig.cs 中的包如下所示:
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
当我现在将代码从头部的样式标签移动到 site.css 时,不再应用自定义样式。我做错了什么?
最佳答案
尝试删除浏览器中的cookies和临时文件
关于html - 移动到 site.css 时未应用样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42773597/