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

CSS reference manual

CSS @rules

CSS attribute大全

CSS border-bottom-width Attribute Usage and Example

border-bottom-The width CSS attribute is used to set the width of the bottom border of the element separately. However, in actual work, it is often used   border-widthorborder-bottomto define the style of the bottom border width.

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

Default Value:medium
Applicable To:All Elements
Inheritance:No
Animatable:Yes.Please refer to Animation Attribute.
Version:CSS 1,2,3
JavaScript Syntax:object object.style.borderBottomWidth="thick"

border-bottom-Syntax of width

The syntax of this attribute is as follows:

border-bottom-width: thin | medium | thick | length | initial | inherit

The following examples demonstrate how to use border-bottom-width Attribute.

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

Note:You must use border-bottom-width Attribute Declaration Beforeborder-styleThe attribute. The element must also have a border, and the border width cannot be 0 before setting the border width, becauseborder-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 adopts its parent element's border-bottom-Calculated Value of width Attribute.

Browser Compatibility

border-bottom-Browser Compatibility of width Attribute, the numbers in the table below represent the minimum version number of browsers that support 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-bottom,border-bottom-color,
border-bottom-style.