HTML | DOM Style borderBottomWidth Property

The style borderBottomWidth property in HTML DOM is used to set or return the width of bottom border of an element.

Syntax:

  • It is used to return the width of bottom border.
    object.style.borderBottomWidth
  • It is used to set the width of the bottom border.
    border-bottom-width: "medium|thin|thick|length|initial|inherit";

Return Value: It returns bottom border width of selected element.



Property Values:

  • medium: It sets the medium size bottom border. It is the default value.
  • thin: It sets the thin border of the bottom.
  • thick: It sets the thick bottom border.
  • length: It sets the width of the border. It does not takes negative value.
  • initial: It sets the borderBottomWidth property to its default value.
  • inherit: This is used to inherits from its parent element.

Example 1: This example use thick value of borderBottomWidth property.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML | DOM Style borderBottomWidth Property
    </title>
    <style>
        div {
            color: green;
            border: 1px solid green;
            text-align: center;
        }
    </style>
</head>
  
<body>
    <div id="main">
        <h1>GeeksforGeeks.!</h1>
    </div>
    <br>
  
    <input type="button" value="Click Me.!" onclick="geeks()" />
  
    <script>
     function geeks() {
        document.getElementById("main").style.borderBottomWidth 
                                                     = "thick";
        }
    </script>
</body>
  
</html>

chevron_right


Output:
Before click on the button:

After click on the button:

Example 2: This example use thin value of borderBottomWidth Property.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
<head>
    <title>
        HTML | DOM Style borderBottomWidth Property
    </title>
    <style>
        div {
            color: green;
            border: 8px solid green;
            text-align: center;
        }
    </style>
</head>
  
<body>
    <div id = "main">
        <h1>GeeksforGeeks.!</h1>
    </div>
    <br>
      
    <input type = "button" value = "Click Me.!" 
        onclick = "geeks()" />
          
    <script>
    function geeks() {
        document.getElementById("main").style.borderBottomWidth
                    = "thin";
    }
    </script>
</body>
</html>                    

chevron_right


Output:
Before click on the button:

After click on the button:

Supported Browsers: The browser supported by Style borderBottomWidth property are listed below:

  • Google Chrome 1.0
  • Internet Explorer 4.0
  • Firefox 1.0
  • Opera 3.5
  • Safari 1.0


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.