【发布时间】:2013-09-01 11:03:10
【问题描述】:
我有一个 base.css,它具有以下 CSS:
.table thead tr th, table th {
text-align:left;
font-size: 11px;
font-weight: bold;
color: #333;
padding: 4px;
background-color: #EEE;
border: #FFF solid;
border-width: 1px 1px 0 0;
border-left: #e7e7e7;
white-space:nowrap; }
我已经在我的 JSP 中包含了这个 CSS。但我需要与base.css 中的颜色不同的颜色,所以我声明如下:
#demo table.header tr {
background:#FDBB30
}
在我的 JSP 中。我之前遇到过这个问题,并发现了 CSS Specificity。第一个的特异性是0,0,1,5,第二个的特异性是0,1,1,2。根据它,表格应该呈现第二个 CSS。但事实并非如此。有什么建议.. ?我无法删除 base.css 我需要它用于其他元素。
我的桌子是这样的:
<table cellpadding="0" cellspacing="0" border="0" align="left" width="100%">
<thead>
<!-- Column Naming for the table -->
<tr>
<th class="header">SName</th>
<th class="header">Report</th>
<th class="header">Owner</th>
<th class="header">STime</th>
<th class="header">SFreq</th>
<th class="header">SDate</th>
<th class="header">EDate</th>
<!-- <th>Action</th> -->
</tr>
</thead>
</table>
【问题讨论】:
标签: html css html-table css-selectors