/

HTML / CSS / JavaScript Tutorial

CSS Property: border-bottom-color

[this page | pdf | back links]

The CSS (CSS1) border-bottom-color property sets the colour of the bottom border of an element. You should always specify the border-style property before this property, as an element must have a border before you can change its characteristics.

 

Valid property values (other than inherit and initial) are:

 

Value

Description

color

Specified CSS colour

transparent

Transparent

 

Default Value:

The current CSS colour of the element

JavaScript syntax:

e.g. object.style.borderBottomColor="red"

Inherited:

No

Animatable:

Yes

 

EXAMPLE:


HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head>
<style>
p {border: thin solid black; width: 200px}
p.x1 {border-bottom-color: red;}
</style>
</head>
<body>
<p>1. Element with default property</p>
<p class="x1">2. Element set using in-file HTML style</p>
<p id="x2">3. Element set using JavaScript</p>

<script>
document.getElementById("x2").style.borderBottomColor = "red";
</script>

</body>
</html>

FUNCTION THAT MAY ASSIST IN TESTING WHETHER FEATURE IS SUPPORTED:
function isSupportedCSSPropertyBorderBottomColor() {
  var x = document.createElement("DIV"); x.style.borderBottomColor = "red"; return (window.getComputedStyle(x, null).borderBottomColor == "red");
}


NAVIGATION LINKS
Contents | Prev | Next | CSS Properties


Desktop view | Switch to Mobile