<table border="1" class="sample">
<tr>
<th>Employee</th>
<th>Salary</th>
<th></th>
</tr>
<tr>
<td>EMP1</td>
<td>10000</td>
<td><input id="btn1" type="button" value="Submit">
</tr>
<tr>
<td>EMP2</td>
<td>12000</td>
<td><input id="btn2" type="button" value="Submit"></td>
</tr>
</table>
我已经在css中设置了交替颜色。即第一行是白色的,第二行是黄色的。问题是第二行的按钮也变成了黄色。我已将不透明度设置为 0.5,以便在页面加载时它看起来是灰色的。如何消除这种颜色重叠?
<style type="text/css">
table.sample {
border: 6px inset #8B8378;
-moz-border-radius: 6px;
}
table.sample td {
border: 1px solid black;
padding: 0.2em 2ex 0.2em 2ex;
color: black;
}
table.sample tr.d0 td {
background-color: #FCF6CF;
}
table.sample tr.d1 td {
background-color: #FEFEF2;
}
</style>