CSS子组合器(>)不起作用
对于我创建的网站,我需要嵌套HTML表格。我有造型的,我不希望被应用于内表的第一行,所以我尝试使用子组合子,像这样的第一外表行(头):CSS子组合器(>)不起作用
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>
我在做什么错?
你可以试试这个选择器table.outside > tbody > tr:first-child
但是如果你分享你的代码,我的帮助会更好。
代码共享,对不起 – 1000000000
已确认:http://jsfiddle.net/QnzkG/5/ –
你可以试试这个选择器table.outside > tbody > tr:first-child
但是如果你分享你的代码,我的帮助会更好。
代码共享,对不起 – 1000000000
已确认:http://jsfiddle.net/QnzkG/5/ –
浏览器通常会添加一个'
'标签,如果你不这样做的话。试试'table.outside> tbody> tr:first-child' –回答
你可以试试这个选择器
table.outside > tbody > tr:first-child
但是如果你分享你的代码,我的帮助会更好。代码共享,对不起 – 1000000000
已确认:http://jsfiddle.net/QnzkG/5/ –
相关问题