border-style
Specifies all border style properties at once.
You can set different styles for each side by providing multiple values separated by spaces.
- 1 value: applied to all four sides.
- 2 values: first applies to top/bottom, second to left/right.
- 3 values: first applies to top, second to left/right, third to bottom.
- 4 values: applied in order — top, right, bottom, left (clockwise).
Sample Code
/* Specifies all four sides. */
div.test { border-style: dashed;}
/* Specifies top/bottom and left/right. */
div.test1 { border-style: dashed solid;}
/* Specifies top, left/right, and bottom. */
div.test2 { border-style: dashed solid dotted;}
/* Specifies top, right, bottom, and left individually. */
div.test3 { border-style: dashed solid dotted double;}
Available Values
| Value | Description |
|---|---|
| none | No border is drawn. The width also becomes 0. This is the initial value. |
| solid | Draws a single solid line border. |
| dashed | Draws a dashed border with larger gaps. |
| dotted | Draws a dotted border with smaller gaps. |
| double | Draws a border with two lines. |
| groove | Draws a border that looks carved in. Opposite of 'ridge'. |
| ridge | Draws a border that looks raised. Opposite of 'groove'. |
| inset | Draws a border that looks embedded. Opposite of 'outset'. |
| outset | Draws a border that looks raised outward. Opposite of 'inset'. |
Browser Preview
<div style="border-style: none; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>S
<div style="border-style: solid; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>
<div style="border-style: dashed; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>
<div style="border-style: dotted; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>
<div style="border-style: double; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>
<div style="border-style: groove; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>
<div style="border-style: ridge; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>
<div style="border-style: inset; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>
<div style="border-style: outset; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>
Browser Support
Desktop
Supported in all versions
8 ○
7 ○
6 ○
2 and earlier ×Mobile
Android Browser
4.4+ ○
3 and earlier ×Same support as desktop
Same support as desktop
※ Version data based on MDN.
Overview
Specifies all border style properties at once.
If no value is set for 'border-style', it defaults to 'none'. With 'none', the border width becomes 0 and no border is drawn. To display any border, you must set 'border-style' to a value other than 'none'.
If you find any errors or copyright issues, please contact us.