Style borderBottomWidthProperty

Style 对象参考手册Style Object

Definition and Usage

The borderBottomWidth property sets or returns the width of the element's bottom border.

Syntax

Set the borderBottomWidth property:

Object.style.borderBottomWidth="thin|medium|thick|length|inherit"

Return the borderBottomWidth property:

Object.style.borderBottomWidth

Value Description
thin Defines a thin border.
medium Default. Defines a medium border.
thick Defines a thick border.
length Defines the width of the border using units such as px, cm, etc.
inherit The width of the bottom border is inherited from the parent element.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the borderBottomWidth property.

Note:IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


Example

Example

Change the width of the bottom border:

<html>
<head>
<style type="text/css">
#ex1
{
border: 1px solid #FF0000;
}
</style>
<script>
function displayResult()
{
document.getElementById("ex1").style.borderBottomWidth="thick";
}
</script>
</head>
<body>

<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Change width of bottom border</button>

</body>
</html>

Try it Yourself »


Style 对象参考手册Style Object Other Extensions