CSS border-left-width property

Definition and usage

The border-left-width property sets the width of the left border of an element.

This only takes effect when the border style is not none. If the border style is none, the border width will actually reset to 0. Negative length values are not allowed.

Note:Always declare the border-style property before the border-left-width property. An element can only change its border width after it has obtained a border.

See also:

Tutorial:CSS Borders

Reference:CSS border-left property

Reference:HTML DOM borderLeftWidth attribute

Example

Set the width of the left border:

p
  {
  border-style:solid;
  border-left-width:15px;
  }

Try it yourself

CSS syntax

border-left-width: medium|thin|thick|length|initial|inherit;

Property value

Value Description
thin Defines a thin left border.
medium Default value. Defines a medium left border.
thick Defines a thick left border.
length Allows you to customize the width of the left border.
inherit Specifies that the border width should be inherited from the parent element.

Technical details

Default value: medium
Inheritance: no
Version: CSS1
JavaScript syntax: object.style.borderLeftWidth="thick"

More examples

Set the width of the left border
This example demonstrates how to set the width of the left border.

Browser support

The numbers in the table indicate the first browser version that fully supports this property.

Chrome IE / Edge Firefox Safari Opera
1.0 4.0 1.0 1.0 3.5

Note:Browsers prior to IE7 do not support the value "inherit". IE8 requires !DOCTYPE. IE9 supports "inherit".