tarihinde yayınlandı Yorum yapın

Border-bottom

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 property is a shorthand property for (in the following order):

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

Show demo ❯

Default value:medium none color
Inherited:no
Animatable:yes, see individual propertiesRead about animatableTry it
Version:CSS1
JavaScript syntax:object.style.borderBottom=”15px dotted lightblue”Try it

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
border-bottom1.04.01.01.03.5

ADVERTISEMENT


CSS Syntax

border-bottom: border-widthborder-styleborder-color|initial|inherit;

Property Values

ValueDescriptionDemo
border-bottom-widthRequired. Specifies the width of the bottom border. Default value is “medium”Demo ❯
border-bottom-styleRequired. Specifies the style of the bottom border. Default value is “none”Demo ❯
border-bottom-colorOptional. Specifies the color of the bottom border. Default value is the color of the textDemo ❯
initialSets this property to its default value. Read about initial
inheritInherits this property from its parent element. Read about inherit

CSS tutorial: CSS Border

HTML DOM reference: borderBottom property