2-29練習,老師正確嗎?
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>:nth-child()</title> <style type="text/css"> /*此处补充样式*/ thead > tr { background:yellow; } tbody tr:nth-child(odd){ color:orange; } tbody tr:nth-child(even){ color:green; } </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>
0
收起
正在回答
1回答
你好同学,实现的正确。继续加油,祝学习愉快!
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星