2-29練習,老師正確嗎?

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>


正在回答

登陆购买课程后可参与讨论,去登陆

1回答

你好同学,实现的正确。继续加油,祝学习愉快!

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师