border-bottom-color

时间:2023-04-22 14:49:23

border-bottom-color 是 CSS 的一个属性,用于设置元素下边框的颜色。它通常和 border-bottom-style 和 border-bottom-width 一起使用来设置下边框的样式和宽度。

该属性的可选值包括:

颜色名称:比如 red, blue, green 等;
十六进制颜色代码:比如 #FF0000, #0000FF, #008000 等;
rgb() 或 rgba() 函数:比如 rgb(255, 0, 0), rgba(0, 0, 255, 0.5) 等;
transparent: 表示透明。
以下是一个示例,展示如何使用 border-bottom-color 属性设置元素下边框的颜色:

<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<style>
.box {
border-bottom-color: red;
border-bottom-style: solid;
border-bottom-width: 2px;
}
</style>
</head>
<body>
<div class="box">Hello world!</div>
</body>
</html>

在上面的例子中,我们创建了一个带下边框的 div 元素,并使用 border-bottom-color 属性将下边框颜色设置为红色。注意,我们还需要通过 border-bottom-style 和 border-bottom-width 属性设置下边框的样式和宽度,否则下边框将不会显示。

相关词 border