Style borderRightProperty
Style Object
Definition and Usage
The borderRight property sets or returns three separate right border properties in shorthand form.
With this property, you can set/return:
- border-right-width
- border-right-style
- border-right-color
Syntax
Set the borderRight property:
Object.style.borderRight="width style color"
Return the borderRight property:
Object.style.borderRight
Tip:The borderRight property has no default value.
| Parameters | Description |
|---|---|
| width | Sets the width of the right border. |
| style | Sets the style of the right border. |
| color | Sets the color of the right border. |
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the borderRight property.
Example
Example
Change the width, style, and color of the right 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.borderRight="thick solid #0000FF";
}
</script>
</head>
<body>
<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Change right 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.borderRight="thick solid #0000FF";
}
</script>
</head>
<body>
<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Change right border</button>
</body>
</html>
Try it yourself »
Style Object Other Extensions