CSSborder-left Property
Example
Set the style of the left border for different elements:
h1 {
border-left: 5px solid red;
}
h2 {
border-left: 4px dotted blue;
}
div {
border-left: double;
}
Try it Yourself »border-left: 5px solid red;
}
h2 {
border-left: 4px dotted blue;
}
div {
border-left: double;
}
Definition and Usage
Theborder-left property is a shorthand property for (in the following order):
If border-left-color is omitted, the color applied will be the color of the text.
| Default value: | medium nonecolor |
|---|---|
| Inherited: | no |
| Animatable: | yes,see individual properties.Read aboutanimatableTry it |
| Version: | CSS1 |
| JavaScript syntax: | object.style.borderLeft="3px dotted blue"Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| border-left | 1.0 | 4.0 | 1.0 | 3.5 | 1.0 |
CSS Syntax
border-left:border-widthborder-styleborder-color|initial|inherit;
Property Values
| Value | Description | Demo |
|---|---|---|
| border-left-width | Optional. Specifies the width of the left border. Default value is "medium" | Demo ❯ |
| border-left-style | Required. Specifies the style of the left border. Default value is "none" | Demo ❯ |
| border-left-color | Optional. Specifies the color of the left border. Default value is the color of the text | Demo ❯ |
| initial | Sets this property to its default value.Read aboutinitial | |
| inherit | Inherits this property from its parent element.Read aboutinherit |
Related Pages
CSS tutorial:CSS Border
HTML DOM reference:borderLeft property

