HTML DOM 样式 borderBottomStyle 属性
htmlweb developmentfront end technology更新于 2024/5/18 7:08:17
borderBottomStyle 属性用于设置或获取元素底部边框的线条样式。
语法
以下是语法 −
设置 borderBottomStyle 属性
object.style.borderBottomStyle = value
值
属性值解释如下 −
| Sr.No | 值 & 说明 |
|---|---|
| 1 | none 这是默认值,表示没有边框。 |
| 2 | hidden 这与"无"相同,但仍会占用边框空间。它基本上是透明的,但仍然存在。 |
| 3 | dotted 这定义了一个点状边框。 |
| 4 | dashed 这定义了一个虚线边框。 |
| 5 | solid 这定义了一个实线边框。 |
| 6 | double 这定义了一个双边框。 |
| 7 | groove 这定义了一个 3d 凹槽边框,与 ridge 相反。 |
| 8 | ridge 这定义了一个 3D 脊状边框,与凹槽。 |
| 9 | inset 这定义了一个 3D 插入边框,其效果看起来像是嵌入的。它产生的效果与 outset 相反。 |
| 10 | outset 这定义了一个 3D 插入边框,其效果看起来像是浮雕的。它产生的效果与 inset 相反。 |
| 11 | initial 用于将此属性设置为初始值。 |
| 12 | inherit 用于继承父级属性值 |
示例
让我们看一个 borderBottomStyle 属性的示例 −
<!DOCTYPE html>
<html>
<head>
<style>
#DIV1{
width:300px;
height:100px;
border-bottom: 8px solid dodgerblue;
border-bottom-style: groove;
}
</style>
<script>
function changeBottomStyle(){
document.getElementById("DIV1").style.borderBottomStyle="dashed";
document.getElementById("Sample").innerHTML="The bottom border style is now changed";
}
</script>
</head>
<body>
<div id="DIV1">SOME SAMPLE TEXT</div>
<p>Change the div bottom border style size by clicking the below button</p>
<button onclick="changeBottomStyle()">Change Bottom Style</button>
<p id="Sample"></p>
</body>
</html>
输出
这将产生以下输出 −

点击"更改底部样式"按钮 −

相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

