首頁  >  文章  >  web前端  >  HTML裡怎麼設定thead表頭的顏色

HTML裡怎麼設定thead表頭的顏色

青灯夜游
青灯夜游原創
2022-01-21 13:43:376683瀏覽

HTML中设置thead表头颜色的方法:1、使用“thead {color: 颜色值;}”语句设置表头的字体颜色;2、使用"thead {background:颜色值;}语句设置表头的背景颜色。

HTML裡怎麼設定thead表頭的顏色

本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。

在HTML中中,创建一个带表头的表格:

<table border="1">
  <thead>
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
  </thead>

  <tfoot>
    <tr>
      <td>Sum</td>
      <td>$180</td>
    </tr>
  </tfoot>

  <tbody>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$80</td>
    </tr>
  </tbody></table>

HTML裡怎麼設定thead表頭的顏色

1、使用color属性设置字体颜色

thead {
color: #FFC0CB;
}

HTML裡怎麼設定thead表頭的顏色

2、使用background属性设置背景颜色

thead {
color: #FFC0CB;
background:blue;
}

HTML裡怎麼設定thead表頭的顏色

(学习视频分享:css视频教程

以上是HTML裡怎麼設定thead表頭的顏色的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn