The borderBottomWidth
property sets or
gets the width of the bottom border.
borderBottomWidth |
Yes | Yes | Yes | Yes | Yes |
Return the borderBottomWidth property:
var v = object.style.borderBottomWidth
Set the borderBottomWidth property:
object.style.borderBottomWidth=thin|medium|thick|length|initial|inherit
Value | Description |
---|---|
thin | thin border |
medium | medium border. default |
thick | thick border |
length | set the thickness |
inherit | inherit the border width from the parent element |
Default Value: | medium; |
---|---|
Return Value: | A string representing the width of bottom border |
CSS Version | CSS1 |
The following code shows how to change the width of the bottom border.
<!DOCTYPE html>
<html>
<head>
<style>
#myDiv {<!--from w w w . ja v a 2 s. c o m-->
border-style: solid;
}
</style>
</head>
<body>
<div id="myDiv">This is a div element.</div>
<button type="button" onclick="myFunction()">test</button>
<script>
function myFunction() {
document.getElementById("myDiv").style.borderBottomWidth = "10px";
}
</script>
</body>
</html>
The code above is rendered as follows:
The following code shows how to change the width of the bottom border to thin.
<!DOCTYPE html>
<html>
<head>
<style>
#myDiv {<!--from ww w . j a v a 2 s. co m-->
border-style: solid;
}
</style>
</head>
<body>
<div id="myDiv">This is a div element.</div>
<button type="button" onclick="myFunction()">test</button>
<script>
function myFunction() {
document.getElementById("myDiv").style.borderBottomWidth = "thin";
}
</script>
</body>
</html>
The code above is rendered as follows:
The following code shows how to get the width of the bottom border.
<!DOCTYPE html>
<html>
<body>
<!--from w w w . j av a 2s .c o m-->
<div id="myDiv" style="border-bottom:thick solid red">This is a div element.</div>
<button type="button" onclick="myFunction()">test</button>
<script>
function myFunction() {
console.log(document.getElementById("myDiv").style.borderBottomWidth);
}
</script>
</body>
</html>
The code above is rendered as follows: