Style borderLeft Property
- Previous page borderImageWidth
- Next page borderLeftColor
- Go back to the previous level HTML DOM Style Object
Definition and Usage
borderLeft
Attributes set or returned in shorthand form to the maximum of three separate left border properties.
With this property, you can set/return the following one or more (in any order):
See Also:
CSS Tutorial:CSS Border
CSS Reference Manual:border-left Property
HTML DOM Reference Manual:border Property
Example
Example 1
Add a left border to the <div> element:
document.getElementById("myDiv").style.borderLeft = "thick solid #0000FF";
Example 2
Change the width, style, and color of the <div> element's left border:
document.getElementById("myDiv").style.borderLeft = "thin dotted red";
Example 3
Return the border-left property value of the <div> element:
alert(document.getElementById("myDiv").style.borderLeft);
Syntax
Return borderLeft Property:
object.style.borderLeft
Set borderLeft Property:
object.style.borderLeft = "width style color|initial|inherit"
Attribute Value
Value | Description |
---|---|
width | Set the width of the left border. |
style | Set the style of the left border. |
color | Set the color of the left border. |
initial. | Set this property to its default value. See initial. |
inherit | Inherit this property from its parent element. See inherit. |
Technical Details
Default Value: | Not specified |
---|---|
Return Value: | A string representing the width, style, and/or color of the element's left border. |
CSS Version: | CSS1 |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Supported | Supported | Supported | Supported | Supported |
- Previous page borderImageWidth
- Next page borderLeftColor
- Go back to the previous level HTML DOM Style Object