HTML DOM Style borderBottomWidth Property


The borderBottomWidth property is used for setting or getting the bottom border width for an element.

Syntax

Following is the syntax for −

Setting the borderBottomWidth property −

object.style.borderBottomWidth = "thin|medium|thick|length|initial|inherit"

values

The property values are explained as follows −

Sr.NoValues & Description
1thin
This specifies a thin border.
2medium
This specifies the medium border and is the default value.
3thick
This specifies a thin border.
4length
This is used for specifying the border width in length units.
5initial
For setting this property to initial value.
6inherit
To inherit the parent property value

Example

Let us look at an example for the borderBottomWidth Property −

<!DOCTYPE html>
<html>
<head>
<style>
   #DIV1{
      height: 100px;
      width: 200px;
      border: 10px groove orange;
      padding: 10px;
      border-bottom-width:30px;
   }
</style>
<script>
   function changeBottomWidth(){
      document.getElementById("DIV1").style.borderBottomWidth="1px";
      document.getElementById("Sample").innerHTML="The bottom border width is now
      decreased";
   }
</script>
</head>
<body>
<div id="DIV1">SOME SAMPLE TEXT</div>
<p>Change the above div bottom border width by clicking the below button</p>
<button onclick="changeBottomWidth()">Change Bottom Width</button>
<p id="Sample"></p>
</body>
</html>

Output

This will produce the following output −

On clicking the “Change Bottom Width” button −

Updated on: 21-Aug-2019

33 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements