1. css
  2. /properties
  3. /border-left-width

border-left-width

Definition

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

Examples

This will create a left border on the element with the class example that is 3 pixels wide.

.example {
  border-left-width: 3px;
}

This will create a left border on the element with the class example that is medium-width (equivalent to 3 pixels).

.example {
  border-left-width: medium;
}

This will create a left border on the element with the class example that is 10 pixels wide.

.example {
  border-left-width: 10px;
}

Values

ValueDescription
thinBorder width is thin (equivalent to 1px)
mediumBorder width is medium (equivalent to 3px)
thickBorder width is thick (equivalent to 5px)
lengthBorder width is a specific length (e.g. 10px, 2em)
initialSets the border width to its default value
inheritInherits the border width from the parent element

Best Practices

  • Use the thin, medium, and thick values for a quick and easy way to set the border width.
  • Use the length value for more precise control over the border width.
  • Use the initial value to set the border width to its default value.
  • Use the inherit value if you want the element to inherit the border width from its parent element.

Browser Compatibility

ChromeFirefoxSafariInternet ExplorerMicrosoft EdgeOpera
YesYesYesYesYesYes