Open In App

CSS border-bottom-width Property

Last Updated : 23 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The border-bottom-width property in CSS is used to set a specific width to the bottom border of an element. The border-bottom-style or border-style property is used for the element before using the border-bottom-width property. 

Syntax:

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

Property Values: The border-bottom-width property values are listed below:

ValueDescription
thinSets a thin border width.
mediumSets a medium border width (default).
thickSets a thick border width.
lengthSets the border width using a specific length value. Does not accept negative values.

Example: In this example we demonstrates the border-bottom-width property using different values (thin, medium, thick, and 20px). Each styled <div> shows a solid green bottom border with specified widths, illustrating how each value affects border thickness.

html
<!DOCTYPE html>
<html>

<head>
    <title>
        border-bottom-width property
    </title>

    <style>
        #thin {
            border-color: green;
            border-bottom-style: solid;
            border-bottom-width: thin;
        }

        #medium {
            border-color: green;
            border-bottom-style: solid;
            border-bottom-width: medium;
        }

        #thick {
            border-color: green;
            border-bottom-style: solid;
            border-bottom-width: thick;
        }

        #length {
            border-color: green;
            border-bottom-style: solid;
            border-bottom-width: 20px;
        }
    </style>
</head>

<body style="text-align:center">

    <h1 style="color:green">GeeksforGeeks</h1>

    <h3>border-bottom-width property</h3>

    <div id="thin">
        border-bottom-width: thin;
    </div><br><br>

    <div id="medium">
        border-bottom-width: medium;
    </div><br><br>

    <div id="thick">
        border-bottom-width: thick;
    </div><br><br>

    <div id="length">
        border-bottom-width: length;
    </div>
</body>

</html>

Output:

  

Supported Browsers: The browser supported by border-bottom-width property are listed below:



Next Article
Article Tags :

Similar Reads