Latest web development tutorials

HTML DOM Style borderRightWidth property

Style Object Reference Style Objects

Definition and Usage

borderRightWidth property sets or returns the width of the element to the right of the box.

grammar

Setting borderRightWidth properties:

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

Back borderRightWidth properties:

Object.style.borderRightWidth

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support borderRightWidth property.

Note: IE7 and earlier versions do not support the "inherit" value.IE8 only provides! DOCTYPE supported "inherit". IE9 support "inherit".


Examples

Examples

Change the width of the box on the right:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<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">这是一些文本。</div>
<br>
<button type="button" onclick="displayResult()">修改右边框的宽度</button>

</body>
</html>

try it"


Style Object Reference Style Objects