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

CSS reference manual

CSS @rules

CSS attribute大全

CSS border-bottom property usage and example

CSS border-The bottom property sets the width, style, and color of the bottom border. It is used to set the bottom border separately, that is, a shorthand property border-bottom-width,border-bottom-styleandborder-bottom-colorIt is a single property declaration.

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

Default value:View all properties
Applicable to:All elements
Inheritance:No
Animatable:Yes,Please refer to the individual property.Please refer to Animation properties.
Version:CSS 1,2,3
JavaScript syntax:object object.style.borderBottom="2px solid red"

border-bottom usage syntax

The syntax of this property is as follows:

border-bottom: [ border-bottom-width border-bottom-style border-bottom-color ] | initial | inherit

The following example demonstrates how to use border-bottom property.

h1 {border-bottom: 5px dashed #ff0000;}
p {border-bottom: 3px dotted #00ff00;}
Test see‹/›

Property value

The following table describes the values of this property.

ValueDescription
border-bottom-widthSet the width of the bottom border of the element.
border-bottom-styleSet the line style of the bottom border of the element.
border-bottom-colorSet the color of the bottom border of the element.
initialSet this property to its default value.
inheritIf specified, the associated element uses the computed value of the border of its parent element.-bottom.

Browser compatibility

border-Browser compatibility of the bottom property, all mainstream browsers support this property.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 4+

  • Apple Safari 1+

  • Opera 4+

Read more

See tutorial:CSS Border,CSS3 Border.

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