Latest web development tutorials

HTML DOM Style borderLeftWidth property

Style Object Reference Style Objects

Definition and Usage

borderLeftWidth property sets or returns the width of the element's left border.

grammar

Setting borderLeftWidth properties:

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

Back borderLeftWidth properties:

Object.style.borderLeftWidth

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support borderLeftWidth 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 left border:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Style type = "text / css">
# Ex1 {
border: 1px solid # FF0000;
}
</ Style>
<Script>
function displayResult () {
document.getElementById ( "ex1") style.borderLeftWidth = "thick".;
}
</ Script>
</ Head>
<Body>

<Div id = "ex1"> This is some text. </ Div>
<br>
<Button type = "button" onclick = "displayResult ()"> modify the width of the left border </ button>

</ Body>
</ Html>

try it"


Style Object Reference Style Objects