CSS border-left property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxFully supports
Internet ExplorerFully supports
EdgeFully supports
OperaFully supports
Description
CSS border-left property defines the width, style, and color for the left side border of a box. It is a shorthand property of border-left-width, border-left-style, and border-left-color.
Syntax
border-left : border-left-width border-left-style border-left-color;
Property values
border-left-width
mediumDefault
-
medium value represents medium sized border for the left side. thin≤medium≤thick
- Try it
border-left-width: medium; +ve length
-
lenght defines the line width of border for the left side. The used units might be px, in, em, pt.
- Try it
border-left-width: 10px;
border-left-style
none
-
There is no style. In this case, the color and width of top border are also ignored i.e. 0px border.
- Try it
border-left-style: none; hidden
-
It is same as 'none' but resolve to different results for the border-collapse property in tables.
- Try it
border-left-style: hidden; dashed
-
The left border consists of a series of square shaped dashes.
- Try it
border-left-style: dashed; double
-
The left border consists of two lines. The total border-left-width equals to the two lines and space between them.
- Try it
border-left-style: double; ridge
-
The content seems to be coming out of the canvas. It is obtained by producing the box-shadow from the two colors that are lighter and darker than the border-color.
The outer side of the left border is darker than the inner side of the left border.
- Try it
border-left-style: ridge; groove
-
The content seems to be going into the canvas. It is obtained by producing the box-shadow from the two colors that are lighter and darker than the border-color.
The inner side of the left border is darker than the outer side of the left border.
- Try it
border-left-style: groove;
border-left-color
currentColorDefault
-
currentColor keyword represents the same color for the left side border as of text color.
- Try it
border-left-color: currentColor; color-name
-
The following demo represents skyblue color for the left side border.
- Try it
border-left-color: skyblue; rgb value
-
It represents rgb value of a color.
The hexadecimal value of red color for the left side border is given below.
- Try it
border-left-color: rgb(255,0,0); hexadecimal value
-
It represents hexadecimal notation of red color.
The hexadecimal notation of blue color for the left side border is given below.
- Try it
border-left-color: #0000ff;
See longhand properties