CSS border-bottom Property

Example

Set the style of the bottom border for different elements:

h1 {
border-bottom: 5px solid red;
}

h2 {
border-bottom: 4px dotted blue;
}

div {
border-bottom: double;
}

Try it Yourself »


Definition and Usage

The border-bottom shorthand property sets all the bottom border properties in one declaration.

The properties that can be set must be in the following order:

  • border-bottom-width
  • border-bottom-style
  • border-bottom-color

If border-left-color is omitted, the color applied will be the color of the text.

Default value: medium none color
Inherited: no
Animatable: yes, see individual propertiesRead about animatable – Try it
Version: CSS1
JavaScript syntax: object.style.borderBottom=”15px dotted lightblue” Try it
CSS Syntax
border-bottom: border-width border-style border-color|initial|inherit;
Property Values
Value Description
border-bottom-width Required. Specifies the width of the bottom border. Default value is “medium”
border-bottom-style Required. Specifies the style of the bottom border. Default value is “none”
border-bottom-color Optional. Specifies the color of the bottom border. Default value is the color of the text
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Related Pages

Post Author: Zahid Farid