The border-color property specifies the border color of an element. Used as a shortcut to determine the entire border color in one rule.

  • Initial valueSee individual properties
  • Applies toAll elements
  • InheritedNo
  • MediaVisual
  • Computed valueSee individual properties
  • AnimatableYes
  • CSS VersionCSS1, CSS2, CSS3
  • JavaScript syntaxobject.style.borderColor
Formal syntax: <color>{1,4} 

border-color: red;
border-color: #333 #777;
border-color: #333 #777 #555;
border-color: #333 #777 #555 #888;
border-color: transparent;
  • <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
.class {
   border-color: #f0f0f0;
}

Click the button below to experiment with this property.

Give it a Try!

1+Firefox6+Explorer1+Chrome1+Safari8+Opera


Last updated on 23rd March 2014 By Rene Spronk

View All CSS Properties

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.