Shorthand to set the 3 properties:
element { border-left: Border-left-width Border-left-style Border-left-color ;}
This shorthand is equivalent to the following:
element { border-left-width: thin | medium | thick | length | inherit ; border-left-style: style ; border-left-color: color ; }
Alternatively you can choose to inherit from a parent element: border-left: inherit ;
The Border-Style property must be set for the Border-Width or Border-Color properties to have any effect.
The default property values, any value that is not specified in the shorthand will be set to the default.
border-left-width: medium; border-left-style: none; border-left-color: 0;
Examples
Set the left border of H1 to a 2px dashed green line:
h1 {border-left: 2px dashed green;}
Set a large left border on a 0px element to create a right pointing triangle:
.right-arr {
width: 0px;
height: 0px;
border-bottom: 20px solid transparent;
border-top: 20px solid transparent;
border-left: 20px solid black;
}
Try it:
This is a sample of text with a CSS border. |
Browser Support: All major browsers (CSS 1)
“I've learned that our background and circumstances may have influenced who we are, but we are responsible for who we become” ~ James Rhinehart
Related:
border-left - MDN Web Docs.
border-bottom - Shorthand to set all the border-bottom properties.
border-right - Shorthand to set all the border-right properties.
border-top - Shorthand to set all the border-top properties.
border - Shorthand to set all the border properties.