我正在尝试设置 html 帮助程序 webgrid 的样式,但在页面呈现时它没有显示我的样式类。
这是我的样式代码:
.gridTable
{
margin: 5px;
padding: 10px;
border: 1px solid #000000;
border-collapse: collapse;
min-width: 550px;
background-color: #fff;
color: #fff;
}
.gridHead th{font-weight: bold;background-color: #030D8D;color: #fff;padding: 10px}
.gridHead a:link,.gridHead a:visited,.gridHead a:active,.gridHead a:hover {color: #fff;}
.gridHead a:hover {text-decoration:underline;}
.gridTable tr.gridAltRow
{
background-color: #FFFF99;
}
.gridTable tr:hover
{
background-color: #CCFFCC;
}
.gridAltRow td
{
padding: 10px;
margin: 5px;
color: #333;
}
.gridRow td{padding: 10px;color: #333;}
.gridFooter td{padding: 10px; background-color: #c7d1d6;color: #999;font-size: 12pt;text-align: center;}
.gridFooter a{font-weight: bold;color: #333; border: 1px #333 solid;}
这是我的网络网格代码:
@grid.GetHtml(tableStyle:"gridTable",
headerStyle:"gridHead",
alternatingRowStyle:"gridAltRow",
rowStyle:"gridRow",
displayHeader:true,
columns:grid.Columns(
grid.Column(header:"", format: @<text>@item.GetSelectLink("Edit")</text>),
grid.Column(columnName: "EntityName", header: "Name"),
grid.Column(columnName: "EntityDBA", header: "DBA"),
grid.Column(columnName: "EntityType", header: "Type")),
mode: WebGridPagerModes.All)
是否有某些原因我错过了为什么不应用该样式?