Place the border outside the edges of the <div> element:
document.getElementById("myDIV").style.borderImageOutset = "5px 10px 20px 15px";
Try it Yourself »
The borderImageOutset property sets or returns the amount by which the border image area extends beyond the border box.
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
borderImageOutset | Yes | 11.0 | Yes | 6.0 | 15.0 |
Look at the borderImage property instead!
Return the borderImageOutset property:
object.style.borderImageOutset
Set the borderImageOutset property:
object.style.borderImageOutset
= "length|
number|initial|inherit"
Note: The borderImageOutset property specifies the amount by which the border image area extends beyond the border box. on the top, right, bottom, and left sides. If the fourth value is omitted, it is the same as the second. If the third one is also omitted, it is the same as the first. If the second one is also omitted, it is the same as the first. Negative values are not allowed for any of the borderImageOutset values.
Value | Description |
---|---|
length | A length unit specifying how far from the edges the border-image will appear. Default value is 0 |
number | Represent multiples of the corresponding border-width |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | 0 |
---|---|
Return Value: | A String, representing the border-image-outset property of an element |
CSS Version | CSS3 |
CSS reference: border-image-outset property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!