How to set the color of thead table header in HTML

青灯夜游
Release: 2022-01-21 13:43:37
Original
6865 people have browsed it

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

How to set the color of thead table header in HTML

本教程操作环境: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>
Copy after login

How to set the color of thead table header in HTML

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

thead {
color: #FFC0CB;
}
Copy after login

How to set the color of thead table header in HTML

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

thead {
color: #FFC0CB;
background:blue;
}
Copy after login

How to set the color of thead table header in HTML

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

The above is the detailed content of How to set the color of thead table header in HTML. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template