border-block-color
Definition
In CSS, the border-block-color property specifies the color of the block borders of an element. The block borders are the vertical borders of the element, which are on the left and right sides in left-to-right languages such as English.
Examples
To set the color of the block borders to red:
div {
border-block-color: red;
}
To set the color of the block borders to a hexadecimal color code:
div {
border-block-color: #ff0000;
}
To set the color of the block borders to a RGB value:
div {
border-block-color: rgb(255, 0, 0);
}
To set the color of the block borders to a HSL value:
div {
border-block-color: hsl(0, 100%, 50%);
}
To make the block borders transparent:
div {
border-block-color: transparent;
}
Values
| Value | Description |
|---|---|
color | Specifies the color of the block borders. The color can be specified using a named color, a hexadecimal color code, a RGB value, or a HSL value. |
transparent | Makes the block borders transparent. |
initial | Sets the property to its default value. |
inherit | Inherits the property from the parent element. |
Best Practices
- Use the
border-block-colorproperty in combination with theborder-block-styleandborder-block-widthproperties to create well-defined block borders for your elements - Use the
border-block-colorproperty to provide visual contrast between different elements on the page - Use the
border-block-colorproperty to draw attention to specific elements or areas on the page - Use the
border-block-colorproperty sparingly, as excessive use of borders can clutter the layout and make the page difficult to read - Use the
transparentvalue for theborder-block-colorproperty to remove the block borders from an element
Browser Compatibility
| Chrome | Firefox | Safari | Internet Explorer | Microsoft Edge | Opera |
|---|---|---|---|---|---|
| Yes | Yes | Yes | No | Yes | Yes |
Some older web browsers may not support the border-block-color property. In particular, Internet Explorer 11 and earlier versions do not support the border-block-color property.