totn CSS

CSS: border-bottom-color property

This CSS tutorial explains how to use the CSS property called border-bottom-color with syntax and examples.

Description

The CSS border-bottom-color property defines the color of the bottom border of a box.

Syntax

The syntax for the border-bottom-color CSS property is:

border-bottom-color: value;

Parameters or Arguments

value

The color of the bottom border. It can be one of the following:

Value Description
#RRGGBB Hexadecimal representation of the border-bottom-color
p { border-bottom-color: #FF0000; }
rgb() RGB representation of the border-bottom-color
p { border-bottom-color: rgb(255,0,0); }
name Name of the border-bottom-color (ie: red, blue, black, white)
p { border-bottom-color: red; }
transparent Border is not displayed but still takes up space on the page
p { border-bottom-color: transparent; }
inherit Element will inherit the border-bottom-color from its parent element
p { border-bottom-color: inherit; }

Note

Browser Compatibility

The CSS border-bottom-color property has basic support with the following browsers:

  • Chrome
  • Android
  • Firefox (Gecko)
  • Firefox Mobile (Gecko)
  • Internet Explorer (IE)
  • IE Phone
  • Opera
  • Opera Mobile
  • Safari (WebKit)
  • Safari Mobile

Example

We will discuss the border-bottom-color property below, exploring examples of how to use this property in CSS.

Using Hexadecimal

Let's look at a CSS border-bottom-color example where we have provided a hexadecimal value for the border-bottom-color property.

p { border-bottom-color: #000000; border-bottom-style: solid; }

In this border-bottom-color example, we have provided a hexadecimal value of #000000 which would display a black bottom border for the <p> tag. Be sure to apply a border-bottom-style so that the border appears.

Using RGB

We can also provide the border-bottom-color value using rgb.

p { border-bottom-color: rgb(0,0,0); border-bottom-style: solid; }

In this border-bottom-color example, rgb(0,0,0) would also display the bottom border for the <p> tag in black.

Using Color Name

Let's look at a CSS border-bottom-color example where we have provided the value as a named color.

p { border-bottom-color: black; border-bottom-style: solid; }

In this CSS border-bottom-color example, we have provided the name "black" which would also set the bottom border to black.