请老师检查!
来源:2-29 编程练习
一穷二白入前端
2020-09-24 21:45:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>:nth-child()</title>
<style type="text/css">
/*此处补充样式*/
thead tr:first-child{background:#ff0;}
tbody tr:nth-child(2n+1){color:orange;}
tbody tr:nth-child(2n){color:#0f0;}
</style>
</head>
<body>
<table border="1" cellspacing="0" width="200">
<thead>
<tr>
<th>序号</th>
<th>姓名</th>
<th>性别</th>
<th>年纪</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>张三</td>
<td>男</td>
<td>12</td>
</tr>
<tr>
<td>2</td>
<td>李四</td>
<td>女</td>
<td>11</td>
</tr>
<tr>
<td>3</td>
<td>赵五</td>
<td>男</td>
<td>12</td>
</tr>
<tr>
<td>4</td>
<td>王二</td>
<td>男</td>
<td>12</td>
</tr>
</tbody>
</table>
</body>
</html>
1回答