Home  >  Article  >  Web Front-end  >  What is the css code to modify the table border color?

What is the css code to modify the table border color?

WBOY
WBOYOriginal
2021-12-08 13:42:013955browse

在css中,修改表格边框颜色的代码是“表格元素{border-color:颜色值;}”;“border-color”属性的作用就是设置元素的边框颜色,该属性值也可以分别设置四个边框的颜色。

What is the css code to modify the table border color?

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

css修改表格边框颜色的代码是什么

在css中,修改表格边框颜色可以利用border-color属性,border-color属性用于设置边框颜色。

示例如下:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    table{
        border-color:#0f9;
    }
    </style>
</head>
<body>
<table border="1">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>
</body>
</html>

输出结果:

What is the css code to modify the table border color?

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

The above is the detailed content of What is the css code to modify the table border color?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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