Category:CSS Properties


The border property specifies the style, width, and color of an element's border. It is a shorthand property for border-width, border-style, and border-color.


Border Property

Setting a <h1> element to a solid red border of 5 pixels width.

h1 {
  border: 5px solid red;


border: border-width border-style border-color;


  • If border-style value is not provided, the default is no border.
  • If no border-color value is chosen, the border color will match the color of the text.
  • If border-width value is not provided, the default is medium.

Additional Information

For more information, see

Found a bug in the documentation? Let us know at