CSS border-bottom-width

The border-bottom-width property in CSS specifies the width of the bottom border of an element. This property allows you to control the thickness of the bottom border using predefined values or custom lengths.


Syntax of border-bottom-width

</>
Copy
border-bottom-width: medium | thin | thick | length | initial | inherit;

Values

ValueDescription
mediumSpecifies a medium border width. This is the default value.
thinSpecifies a thin border width.
thickSpecifies a thick border width.
lengthSpecifies the width of the border in any valid CSS length unit (e.g., 2px, 0.5em).
initialSets the property to its default value (medium).
inheritInherits the value from its parent element.

Default Value

medium


Examples for border-bottom-width

Using the CSS border-bottom-width Property

The following examples demonstrate how to use the border-bottom-width property to set the width of the bottom border.

</>
Copy
/* Set the bottom border width to medium */
.element {
  border-bottom-width: medium;
}

/* Set the bottom border width to thin */
.element {
  border-bottom-width: thin;
}

/* Set the bottom border width to 5px */
.element {
  border-bottom-width: 5px;
}

/* Inherit the bottom border width from the parent */
.element {
  border-bottom-width: inherit;
}

Example for a Thick Bottom Border

Below is an example demonstrating how to apply a thick bottom border using border-bottom-width: thick:

index.html

</>
Copy
<!DOCTYPE html>
<html lang="en">
<head>
<style>
  .box {
    border-bottom-width: thick;
    border-bottom-style: solid;
    background-color: yellow;
    padding: 5px;
  }
</style>
</head>
<body>

<h1>Thick Bottom Border</h1>
<div class="box">This is sample content.</div>

</body>
</html>

Example for a Bottom Border Width of 20px

border-bottom-width: 20px;

</>
Copy
<!DOCTYPE html>
<html lang="en">
<head>
<style>
  .box {
    border-bottom-width: 20px;
    border-bottom-style: solid;
    background-color: yellow;
    padding: 5px;
  }
</style>
</head>
<body>

<h1>Thick Bottom Border</h1>
<div class="box">This is sample content.</div>

</body>
</html>

Browser Support

The border-bottom-width property is supported in modern browsers. Below is a compatibility table:

BrowserVersion
Chrome1.0
Edge4.0
Firefox1.0
Safari1.0
Opera3.5