📜  HTML | DOM 样式 borderBottomWidth 属性(1)

📅  最后修改于: 2023-12-03 15:01:12.694000             🧑  作者: Mango

HTML | DOM 样式 borderBottomWidth 属性

borderBottomWidth 属性设置元素的下边框宽度。

语法
object.style.borderBottomWidth = "medium|thin|thick|length";
属性值
  • medium:默认值,设置为中等宽度。
  • thin:设置为细线。
  • thick:设置为粗线。
  • length:设置为一个整数值的长度。默认单位为像素,可以使用其他CSS单位。
继承性

不会被继承。

示例

以下代码演示如何使用 borderBottomWidth 属性:

<!DOCTYPE html>
<html>
<head>
  <style>
    div {
      border: 2px solid black;
      border-bottom-width: 10px;
    }
  </style>
</head>
<body>

<div>This is a sample text.</div>

</body>
</html>

输出结果:

This is a sample text.
兼容性

|特性|Chrome|Edge|Firefox(Gecko)|IE|Opera|Safari(WebKit)| |---|---|---|---|---|---|---| |基础支持|1.0|12.0|1.0(1.7或更早的版本)|4.0|(Yes)|1.0|

注意事项
  • 设置 border-bottom-width 的效果是在元素的 border 属性之后进行的。
  • 如果同时设置了 borderborder-bottom-width 属性,那么以 border-bottom-width 的值为准。
参考资料