English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Comprehensive List of CSS Properties

CSS border-left-Usage and example of width attribute

border-left-The width CSS attribute is used to set the width of the left border of the element separately. However, in many cases, likeborder-widthorborder-leftSuch a shorthand CSS attribute is more convenient and preferable to use.

The following table provides usage instructions and version history of this attribute, as well as the syntax of using this attribute in JavaScript scripts.

Default value:medium
Applicable to:All elements
Inheritance:No
Animated:Yes.Please refer to Animation attribute.
Version:CSS 1,2,3
JavaScript syntax:    object.style.borderLeftWidth="thick"

border-left-The syntax of width

The syntax of this attribute is as follows:

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

The following examples demonstrate how to use the border-left-width attribute.

  p {
   border-style: solid;
   border-left-width: 15px;
  }
Test to see‹/›

Note:You must specify in the border-bottom-width attribute was declared beforeborder-styleAttribute. The element must also have a border before the border width can be set, because theborder-styleThe default value of the attribute is none.

Attribute value

The following table describes the values of this attribute.

ValueDescription
thinThin border.
mediumMedium border.
thickThick border.
lengthLength values in units such as px, pt, cm, em, etc., but negative values are not allowed.
initialSet this attribute to its default value.
inheritIf specified, the associated element uses its parent element's border-left-The value of the width attribute.

Browser compatibility

border-left-Browser compatibility of the width attribute; the numbers in the table below represent the minimum version number of the browser that supports this attribute; all mainstream browsers support this attribute.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 4+

  • Apple Safari 1+

  • Opera 4+

Further reading

See tutorial:CSS Border,CSS3 Border.

Related properties:border,border-width,border-left,border-left-color,
border-left-style.