CSS Property border-bottom








This shorthand property defines the width, color, and style of the bottom border.

Summary

ItemValue
Initial value not specified
Inherited No.
Version CSS1
JavaScript syntax object.style.borderBottom="5px solid red"
Applies to All elements.




CSS Syntax

border-bottom: border-width border-style border-color;

Property Values

The property values are listed in the following table.

Value Description
border-bottom-width Set the width of the bottom border
border-bottom-style Set the style of the bottom border
border-bottom-color Set the color of the bottom border
inherit Inherit the border-bottom property from the parent element

Browser compatibility

border-bottom Yes Yes Yes Yes Yes




Example

An example showing how to use border-bottom CSS property.

<!DOCTYPE HTML>
<html>
<head>
<style>
span {<!--  w  ww  . ja  v  a  2 s  .  c om-->
  border-bottom: 1px dotted black;
}
</style>
</head>
<body>
<p> 
    <span>Under 5</span>
</p> 
</body>
</html>

Click to view the demo