The border property sets the border properties. Used as a type of shortcut, instead of listing each property separately. The border property can be used to set the values for one or more of: border-width, border-style and border-color.

  • Initial valueSee individual properties
  • Applies toAll elements
  • InheritedNo
  • MediaVisual
  • Computed valueSee individual properties
  • AnimatableSee individual properties
  • CSS VersionCSS1, CSS2, CSS3
  • JavaScript
Formal syntax: <line-width> || <line-style> || <color>

border: 1px solid red;
border: 1px solid;
border: 1px red;
border: solid red;
.class {
   border: 1px solid #FFF7B5

Click the button below to experiment with this property.

Give it a Try!


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.