Border Style

Category:CSS Properties

Border Style

The border-style property specifies the line style for all four sides of an element's border. It is a shorthand for top, right, bottom, and left border style respectively. When one value is specified, it applies the same border style to all four sides. There are various border style values, such as solid, dashed, dotted, double, groove, etc.


Dashed Border

Setting a dashed border for all four sides of a <h1> element.

h1 {
  border-style: dashed;

Different Border Styles

Setting different borders on each side of a <h1> element.

h1 {
  border-style: dotted solid dashed double;


border-style: value;


  • The default value specifies no border.
  • The border style property can take one to four values at a time.
  • Always declare the border style property before applying any other CSS border properties.

Additional Information

For more information, see

Found a bug in the documentation? Let us know at