程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程解疑 >> table-為何用於設置表格的class作用不上來?

table-為何用於設置表格的class作用不上來?

編輯:編程解疑
為何用於設置表格的class作用不上來?

樣式class1使用後沒反應,代碼如下

 <style type="text/css">
            #city th{
                background-color: darkcyan;
            }
            #city tfoot td{
                background-color: darkgrey;
            }
        #city{
                border-collapse: collapse;/*設置表格的邊框合並為一個單一的邊框*/
                /*border: 1px solid salmon;*/
            }
            #city th,td{
                border: 1px solid salmon;
            }
            .class1{
                border-bottom: 1px  solid darkseagreen;
            }
        </style>
    </head>
    <body>
        <table width="400px"  id="city" >
            <caption>首都</caption>
            <thead>
                <tr>
                    <th>北京</th>
                    <th>北京</th>
                    <th>北京</th>
                </tr>
            </thead>
                <tr class="class1">
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                    <tr class="class1">
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            <tfoot>
                <tr><td colspan="3">以上資料純屬虛假</td></tr>
            </tfoot>

        </table>

    </body>
</html>

最佳回答:


     tr.class1 td {
        border-bottom: 1px solid darkseagreen;
    }
baidu_34197758
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved