Categories
CSS Web development

CSS border-bottom-width Property

CSS border-bottom-width Property

The CSS border-bottom-width property settles the width of an element’s bottom border.

Demo:

Syntax:

border-bottom-width: medium|thin|thick|length;

medium (default) – defines a medium bottom border.

thin – defines a thin bottom border.

thick – defines a thick bottom border.

length – allows you to specify the thickness of the bottom border (CSS Units).

Example1:

Set the width of the bottom border to medium:

<!DOCTYPE html>
<html>
<head>
<style>
p {
  border-bottom-style: solid;
  border-bottom-width: medium;
}

div {
  border-style: solid;
  border-bottom-width: medium;
}
</style>
</head>
<body>

<p>A paragraph with a medium bottom border.</p>

<div>A div element with a medium bottom border.</div>

</body>
</html>

Output:

A paragraph with a medium bottom border.

A div element with a medium bottom border.

Example2:

Set the width of the bottom border to 5px:

<!DOCTYPE html>
<html>
<head>
<style>
p {
  border-bottom-style: solid;
  border-bottom-width: 5px;
}

div {
  border-style: solid;
  border-bottom-width: 5px;
}
</style>
</head>
<body>

<p>A paragraph with a 5px thick bottom border.</p>

<div>A div element with a 5px thick bottom border.</div>

</body>
</html>

Output:

A paragraph with a 5px thick bottom border.

A div element with a 5px thick bottom border.

Enjoy coding!

Read also:

CSS border-radius property

Advanced CSS Border-radius/ Drop Shape, Lemon Shape, Leaf Shape & Egg Shape