我有一些像这样的HTML:
<table id="MatrixTable" class="zebra-striped">
<thead>
<tr style="background-color: White;">
<td style="min-width: 31px !important;">
...
</td>
如您所见,我在html代码中将背景颜色设置为白色。
接下来,如果我在CSS中设置它,那么它就不再起作用了。奇怪,因为当我在运行时检查CSS(IE F12)时,我可以看到thead / tr的背景颜色为白色。
#MatrixTable thead tr
{
background-color: White !important;
}
为什么这不适用于CSS文件?我的css文件中的其他内容已正确应用。
感谢。
答案 0 :(得分:1)
td
),这些元素的样式可能会使此样式无效。White
更改为white
旁注:尽可能避免!important
,导致草率风格导致此类问题。它并不意味着用于这些目的。
答案 1 :(得分:0)
请改用此CSS选择器:
#MatrixTable thead tr td {
background-color: #FFF !important;
}