Change the width of the bottom border of a <div> element to 10px:
document.getElementById("myDiv").style.borderBottomWidth = "10px";
Try it Yourself »
More "Try it Yourself" examples below.
The borderBottomWidth property sets or returns the width of the bottom border of an element.
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
borderBottomWidth | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Return the borderBottomWidth property:
object.style.borderBottomWidth
Set the borderBottomWidth property:
object.style.borderBottomWidth = "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 |
Default Value: | medium |
---|---|
Return Value: | A String, representing the width of an element's bottom border |
CSS Version | CSS1 |
Change the width of the bottom border of a <div> element to thin:
document.getElementById("myDiv").style.borderBottomWidth = "thin";
Try it Yourself »
Return the width of the bottom border of a <div> element:
alert(document.getElementById("myDiv").style.borderBottomWidth);
Try it Yourself »
CSS tutorial: CSS Border
CSS reference: border-bottom-width property
HTML DOM reference: border property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!