自强学堂
自强学堂:学习、分享、让你更强!
JavaScript 参考手册HTMLCSSJAVASCRIPTJQUERYSQLPHPBOOTSTRAPANGULARXML
 

HTML DOM Style borderRightWidth 属性

Style 对象参考手册 Style 对象

定义和用法

borderRightWidth 属性设置或返回元素的右边框的宽度。

语法

设置 borderRightWidth 属性:

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

返回 borderRightWidth 属性:

Object.style.borderRightWidth

描述
thin定义细的边框。
medium默认。定义中等的边框。
thick定义粗的边框。
length使用 px、cm 等单位定义边框的宽度。
inherit右边框的宽度从父元素继承。


浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要浏览器都支持 borderRightWidth 属性。

注意:IE7 及更早的版本不支持 "inherit" 值。IE8 只有规定了 !DOCTYPE 才支持 "inherit"。IE9 支持 "inherit"。


实例

实例

更改右边框的宽度:

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

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

</body>
</html>

尝试一下 »


Style 对象参考手册 Style 对象