将 <div> 元素左边框的宽度更改为 10px:
document.getElementById("myDiv").style.borderLeftWidth = "10px";
亲自试一试 »
borderLeftWidth 属性设置或返回元素左边框的宽度。
Property | |||||
---|---|---|---|---|---|
borderLeftWidth | Yes | Yes | Yes | Yes | Yes |
返回 borderLeftWidth 属性:
object.style.borderLeftWidth
设置 borderLeftWidth 属性:
object.style.borderLeftWidth = "thin|medium|thick|
length|initial|inherit"
Value | Description |
---|---|
thin | Defines a thin border |
medium | Defines a medium border. This is default |
thick | Defines a thick border |
length | The width of the border in length units |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
默认值: | 中等的 |
---|---|
返回值: | 一个 String,表示元素左边框的宽度 |
CSS版本 | CSS1 |
CSS教程:CSS 边框
CSS 参考:左边框宽度属性
HTML DOM 参考:边境属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!