<分区>
对于我正在创建的网站,我需要嵌套 HTML 表格。我有第一个外部表格行(标题)的样式,我不想应用于内部表格的第一行,所以我尝试像这样使用子组合器:
table.outside > tr:first-child {
# Outside table header row styles
}
但是,该样式不会应用于外部表格的标题行,但是当我删除子组合器时它会起作用。
这是我的 HTML:
<table class="outside">
<tr><!-- This should be styled -->
<th>Column 1</th>
<th>Column 2</th>
</tr>
<tr>
<td>
<table>
<tr><!-- Table Data --></tr><!-- This should not be styled -->
<tr><!-- Table Data --></tr>
</table>
</td>
</tr>
<!-- Etc. -->
</table>
我做错了什么?