CSS border-color Property
Description
The border-color property controls the color used to draw an element’s border. It determines the visual tint applied to the border lines that form the element’s perimeter, and is used by the rendering engine when a border is present. Setting this property adjusts only the painting color; it does not by itself create or remove a border - that depends on other border-related properties that define width and style.
Because a border only appears when a non-none style and a positive width are present, border-color is often used together with border-style and with width-related properties (or a shorthand) to produce the final visible edge. It can be thought of as the colour component of the border box: if the border style is set to a value that doesn’t render (for example, no border), the color will have no visible effect. For managing multiple border properties at once, authors frequently use the shorthand border to set width, style and color in a single declaration.
Visually, border color interacts with an element’s background and surrounding elements. Choosing a border color affects perceived separation, emphasis and contrast against the element’s background-color and the page background, and it can either reinforce or conflict with the element’s text color (color) depending on design intent. Borders can be used subtly to suggest structure or more strongly to create emphasis; designers should consider contrast and clarity so borders improve usability rather than creating noise.
In practice, border-color is commonly animated or transitioned for interactive effects (hover, focus, validation states), and it composes well with other outline and focus visuals - for example, an outline may be used in addition to a colored border for accessibility or focus indication. When altering borders in responsive or stateful designs, keep in mind that color changes are a powerful affordance and should be used consistently to maintain predictable visual language.
Definition
- Initial value
- See individual properties
- Applies to
- All elements
- Inherited
- No
- Computed value
- See individual properties
- Animatable
- Yes
- JavaScript syntax
- object.style.borderColor
Interactive Demo
Syntax
border-color: <color>{1,4}
Values
- <color>Specify the color to use on all borders. This can be anywhere from one to four values representing the top, right, bottom, and left border respectively.
- transparentThis will apply a border that is not visible but it can have a width applied.
- inherit
Example
Browser Support
The following information will show you the current browser support for the CSS border-color property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
