Style borderRight 属性
 Style 对象
 Style 对象
定义和用法
borderRight 属性以速记形式设置或返回三个独立的右边框属性。
通过该属性,您可以设置/返回:
- border-right-width
- border-right-style
- border-right-color
语法
设置 borderRight 属性:
Object.style.borderRight="width style color"
返回 borderRight 属性:
Object.style.borderRight
提示:borderRight 属性没有默认值。
| 参数 | 描述 | 
|---|---|
| width | 设置右边框的宽度。 | 
| style | 设置右边框的样式。 | 
| color | 设置右边框的颜色。 | 
浏览器支持





所有主要浏览器都支持 borderRight 属性。
实例
实例
更改右边框的宽度、样式和颜色:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>代码学院(codexy.cn)</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">这是一些文本。</div>
<br>
<button type="button" onclick="displayResult()">修改右边框</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>代码学院(codexy.cn)</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">这是一些文本。</div>
<br>
<button type="button" onclick="displayResult()">修改右边框</button>
</body>
</html>
尝试一下 »
 Style 对象
 Style 对象			
						
			
 JavaScript 教程
JavaScript 教程 JavaScript 对象
JavaScript 对象 jQuery 教程
jQuery 教程 JSON 教程
JSON 教程 AngularJS 教程
AngularJS 教程 Angular 2 教程
Angular 2 教程 Vue.js 教程
Vue.js 教程 React 教程
React 教程 jQuery UI 教程
jQuery UI 教程 jQuery EasyUI 教程
jQuery EasyUI 教程 AJAX 教程
AJAX 教程 Highcharts 教程
Highcharts 教程 Google Maps API 教程
Google Maps API 教程 ES6 教程
ES6 教程 TypeScript教程
TypeScript教程 ES6 标准入门
ES6 标准入门