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-color
property in combination with theborder-block-style
andborder-block-width
properties to create well-defined block borders for your elements - Use the
border-block-color
property to provide visual contrast between different elements on the page - Use the
border-block-color
property to draw attention to specific elements or areas on the page - Use the
border-block-color
property sparingly, as excessive use of borders can clutter the layout and make the page difficult to read - Use the
transparent
value for theborder-block-color
property 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.