Style borderBottomProperty
Style Object
Definition and Usage
The borderBottom property sets or returns the three individual border-bottom properties in shorthand form.
Through this property, you can set/return:
- border-bottom-width
- border-bottom-style
- border-bottom-color
Syntax
Setting the borderBottom property:
Object.style.borderBottom="width style color"
Returning the borderBottom property:
Object.style.borderBottom
Tip:The borderBottom property has no default value.
| Parameters | Description |
|---|---|
| width | Sets the width of the bottom border. |
| style | Sets the style of the bottom border. |
| color | Sets the color of the bottom border. |
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the borderBottom property.
Example
Example
Change the width, style, and color of the bottom border:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example Tutorial(example.com)</title>
<style type="text/css">
#ex1{
border: thin dotted #FF0000;
}
</style>
<script>
function displayResult(){
document.getElementById("ex1").style.borderBottom="thick solid #0000FF";
}
</script>
</head>
<body>
<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Modify bottom border</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Example Tutorial(example.com)</title>
<style type="text/css">
#ex1{
border: thin dotted #FF0000;
}
</style>
<script>
function displayResult(){
document.getElementById("ex1").style.borderBottom="thick solid #0000FF";
}
</script>
</head>
<body>
<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Modify bottom border</button>
</body>
</html>
Try it Yourself »
Style Object Other Extensions