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

CSS Reference Manual

CSS @rules (RULES)

Complete List of CSS Properties

CSS border-bottom-color attribute usage and example

CSS border-bottom-The color attribute is used to set the color of the bottom border of the element separately. However, in practical work, we usually use the border shorthand property, that isborder-colororborder-bottomto set the style or color of the border.

The following table summarizes the usage context and version history of this attribute.

Default value:colorAttribute value
Applicable to:All elements
Inheritance:No
Animatable:Yes.Please refer to Animation attribute.
Version:CSS 1,2,3
JavaScript syntax:object object.style.borderBottomColor="red"

border-bottom-color usage syntax

The syntax of this attribute is as follows:

border-bottom-color: color | transparent | inherit

The following examples demonstrate how to use border-bottom-color attribute.

  p {
   border-style: solid;
   border-bottom-color: #ff0000;
  }
Test and see‹/›

Note:Must be in CSS border-bottom-color attribute declaration beforeborder-styleThis attribute must be declared before the color attribute of the element, and the element must have a border to set the border color.

Attribute value

The following table describes the value of this attribute.

ValueDescription
ColorSpecify the color of the top border. SeeCSS color valuesto get the list of possible color values.
transparentAllow the border to be transparent, although it may take upborder-widthThe space of the attribute setting.
initialSet this attribute to its default value.
inheritIf specified, the associated element adopts its parent element's border-bottom-The calculated value of the color attribute.

Browser compatibility

border-bottom-The compatibility of the color attribute of browsers, the numbers in the following table represent the minimum version number of the browsers that support this attribute, and 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-color,border-bottom,border-bottom-style,
border-bottom-width.