Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Change the color of the bottom border with CSS
The border-bottom-color CSS property changes the color of an element's bottom border. This property only affects the color, not the width or style of the border.
Syntax
border-bottom-color: color;
Parameters
The property accepts standard CSS color values including hex codes, RGB values, HSL values, and named colors.
Example
<html>
<head>
<style>
p.demo {
border: 4px solid black;
border-bottom-color: #FF0000;
padding: 10px;
}
.multiple-colors {
border: 3px solid;
border-top-color: blue;
border-right-color: green;
border-bottom-color: red;
border-left-color: orange;
padding: 15px;
margin: 10px 0;
}
</style>
</head>
<body>
<p class="demo">
This paragraph has a red bottom border
</p>
<div class="multiple-colors">
This div demonstrates different border colors on each side
</div>
</body>
</html>
Output
The first paragraph will display with a solid black border on three sides and a red bottom border. The second element shows how you can set different colors for each border side.
Common Use Cases
The border-bottom-color property is commonly used for:
- Creating accent lines under headings
- Highlighting active navigation items
- Adding visual separation between sections
- Creating custom underline effects
Key Points
- The element must have a bottom border defined for the color to be visible
- Works with any valid CSS color value
- Can be combined with other border properties for custom styling
- Inherits from the parent element if not explicitly set
Conclusion
The border-bottom-color property provides precise control over bottom border colors. Use it with existing borders to create visual emphasis and improve design aesthetics.
Advertisements
