HTML DOM Style borderBottomColor Property


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.NoValue & Description
1color
For specifying the bottom border color. The default color is black.
2transparent
For making the bottom border transparent i.e. the content can be seen from the bottom.
3Initial
For setting this property to initial value.
4Inherit
To inherit the parent property value.

Example

Let us look at an example for the borderBottomColor property −

Live Demo

<!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” −

Updated on: 15-Feb-2021

29 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements