border-left-width 1c5x3q
The border-left-width property is used to set the width of the left border of an element. 5f5s57
The width of the border can be explicitly set using a <length>
value, or by using one of three border width keywords: thin
, medium
, and thick
.
Official Syntax 3xs5l
- Syntax:
border-left-width: <length> | thin | medium | thick
- Initial: medium
- Applies To: all elements
- Animatable: yes
Notes 441w3q
Note that the initial width is medium
, but the initial border style of an element is none
and therefore the used width is 0.
Values u704t
- <length>
- The width of the border is set to the specified length. Negative values are not allowed.
- thin
- Implementation-specfic. See note below and the live demo for examples.
- medium
- Implementation-specfic. See note below and the live demo for examples.
- thick
- Implementation-specfic. See note below and the live demo for examples.
Notes 441w3q
The specification doesn’t precisely define the thickness of each of the keywords, which is therefore implementation specific, but the values are constant throughout a document and thin ? medium ? thick. A browser could, for example, make the thickness depend on the medium
font size: one choice might be 1px (for thin
), 3px (for medium
) & 5px (for thick
) when the medium
font size is 17px or less.
The border-left-width
property can also inherit the value of the element’s parent’s left border width using the keyword inherit
.
Examples 2h2053
The following are all valid border-left-width
values set on an element. The element’s border style and border color are also set using the border-left-color
respectively.
.element { border-left-style: dotted; border-left-color: red; border-left-width: 10px; /* or */ border-left-width: thin; /* or */ border-left-width: 1em; }
Browser 572e63
The property works in all major browsers: Chrome, Firefox, Safari, Opera, IE, and on Android and iOS.