The borderBottomColor property is used to set or get the bottom border color of an element. It is essential to declare the border-style as the element must have a border for this property to work.
Syntax
Following is the syntax for setting the borderBottomColor property −
object.style.borderBottomColor = "color|transparent|initial|inherit"
Following is the syntax to return the borderBottomColor property −
object.style.borderBottomColor
Values
The property values are explained as follows −
Sr.No | Value & Description |
---|---|
1 | color For specifying the bottom border color. The default color is black. |
2 | transparent For making the bottom border transparent i.e. the content can be seen from the bottom. |
3 | Initial For setting this property to initial value. |
4 | Inherit To inherit the parent property value. |
Example
Let us look at an example for the borderBottomColor property −
<!DOCTYPE html> <html> <head> <style> #IMG1 { border-bottom: 7px solid orange; box-shadow: 2px 2px 4px 1px seagreen; } </style> <script> function changeBorder(){ document.getElementById("IMG1").style.borderBottomColor="pink"; document.getElementById("Sample").innerHTML="The bottom border color for the image is now changed"; } </script> </head> <body> <h2>iOS Tutorial</h2> <img id="IMG1" src="https://www.tutorialspoint.com/ios/images/ios.jpg"> <p>Change the above image's below border...</p> <button onclick="changeBorder()">Change Bottom Border</button> <p id="Sample"></p> </body> </html>
Output
This will produce the following output −
On clicking the “Change Bottom border” −