我从样式表中的所有TD元素中删除了填充。但是我有一个特别的桌子cellpadding="10"
。由于上述样式,其TD呈现为具有0px填充。
我应该如何将TD填充重置为空,以便从cellpadding继承10px填充?
td {padding:0}
#specialtable td {
/* What should I write here? */
}
<table id="specialtable" cellpadding="10" style="border:1px solid #555555">
<tr>
<td>test</td>
</tr>
</table>
您可以使用:不是伪类来定义填充所有td
除了那些下#specialTable
。
table:not(#specialTable) td {
padding: 0;
}
<table id="specialTable" cellpadding="10" style="border:1px solid #555555">
<tr>
<td>test</td>
</tr>
</table>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句