border-width
Specifies all border width properties at once.
You can set different widths 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-width: medium;}
/* Specifies top/bottom and left/right. */
div.test1 { border-width: medium 5px;}
/* Specifies top, left/right, and bottom. */
div.test2 { border-width: medium 5px 8px;}
/* Specifies top, right, bottom, and left individually. */
div.test3 { border-width: medium 5px 8px 10px;}
Available Values
| Value | Description |
|---|---|
| Number | Specifies the border width in units such as 'px'. |
| thin | The keyword 'thin'. Typically rendered as 1px, though it may vary slightly by browser. |
| medium | The keyword 'medium'. Typically rendered as 3px, though it may vary slightly by browser. This is the initial value when no 'border-width' is specified. |
| thick | The keyword 'thick'. Typically rendered as 5px, though it may vary slightly by browser. |
Browser Preview
※ The samples below have 'border-style' set to 'solid'.
Browser Support
Desktop
Supported in all versions
8 ○
7 ○
6 ○
2 and earlier ×Mobile
2 and earlier ×
Android Browser
2+ ○Same support as desktop
Same support as desktop
※ Version data based on MDN.
If you find any errors or copyright issues, please contact us.