Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

CSS Dictionary

  1. Home
  2. CSS Dictionary
  3. border-left

border-left

Sets left border properties at once. The properties you can specify together are『border-color』,『border-style』, and『border-width』. The order of values does not matter.

Sample Code

div.test { border-left: dashed;}
div.test1 { border-left: dashed 2px;}
div.test2 { border-left: solid 2px #000;}

Available Values (border-color)

ValueDescription
transparentSets the border to transparent.
Color code or color nameChanges the border to the specified color. If no『border-color』value is set, the color of the『color』property is used as the default.

Available Values (border-style)

ValueDescription
noneNo border is drawn. The width is also set to 0. This is the default value.
solidDraws a single solid line.
dashedDraws a dashed border with larger gaps.
dottedDraws a dotted border with smaller gaps.
doubleDraws a double line border.
grooveDraws a border that looks carved in. The opposite of『ridge』.
ridgeDraws a border that looks raised. The opposite of『groove』.
insetDraws a border that looks embedded. The opposite of『outset』.
outsetDraws a border that looks raised outward. The opposite of『inset』.

Available Values (border-width)

ValueDescription
NumberSpecifies the border width using units such as『px』.
thinSpecifies using the keyword『thin』. Most browsers display this as 1px, though it may vary slightly.
mediumSpecifies using the keyword『medium』. Most browsers display this as 3px, though it may vary slightly. This is the default when no『border-width』value is specified.
thickSpecifies using the keyword『thick』. Most browsers display this as 5px, though it may vary slightly.

Browser Preview

<div style="border-left: none; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-left: solid 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-left: dashed 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-left: dotted 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-left: double 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-left: groove 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-left: ridge 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-left: inset 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

<div style="border-left: outset 10px #cccccc; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

Browser Compatibility

Chrome Chrome
1+
Firefox Firefox
1+
Safari Safari
1+
Edge Edge
12+
Supported in all versions
IE IE
11
10
9
8
7
6
Opera Opera
3.5+
2 and below ×
iOS Safari iOS Safari
1+
Android Android Browser
4.4+
3 and below ×
Chrome Android Chrome Android
Latest
Same support as desktop version
Firefox Android Firefox Android
Latest
Same support as desktop version

※ Version information is based on MDN.

Notes

You can set the border-related properties『border-color』,『border-style』, and『border-width』at once. The order of values does not matter.

When you write the『border-left』property, any left border values not specified will be reset to their initial values. This means all previously set left border properties are overridden.

<div style="border-width: 10px; border-style: dashed; border-left: solid; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>

To display any left border, you must specify the『border-style』property. Since the default value of『border-style』is『none』(width 0), no border will be drawn unless a value is specified.

If you find any errors or copyright issues, please .