Latest web development tutorials

HTML DOM Style borderRight property

Style Object Reference Style Objects

Definition and Usage

borderRight shorthand property to set or return the right border of three independent properties.

With this property, you can set / return:

  • border-right-width
  • border-right-style
  • border-right-color

grammar

Setting borderRight properties:

Object.style.borderRight="width style color"

Back borderRight properties:

Object.style.borderRight

Tip: borderRight property has no default value.

参数 描述
width 设置右边框的宽度。
style 设置右边框的样式。
color 设置右边框的颜色。


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support borderRight property.


Examples

Examples

Change the right border width, style, and color:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.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 ()"> Modify the right of the box </ button>

</ Body>
</ Html>

try it"


Style Object Reference Style Objects