<table>
<tr>
<td>1</td>
</tr>
<tr>
<td>2</td>
</tr>
<tr>
<td>3</td>
</tr>
<tr>
<td>4</td>
</tr>
<tr>
<td>5</td>
</tr>
<tr>
<td>6</td>
</tr>
<tr>
<td>7</td>
</tr>
<tr>
<td>8</td>
</tr>
</table>
我想用不同的颜色给第 4、5 和 6 着色 我如何通过第 n 个 child 选择它。难以理解
table tr:first-child{background-color: #F57676;}
table tr:nth-child(even){background-color: #F5B3B3;}
table tr:nth-child(odd){background-color: #F2DCDC;}
table tr:last-child{ background-color: #F57676;}
谢谢
最佳答案
关于jquery - CSS jQuery 选择器第 n 个 child ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20323194/