border-width

A shorthand for setting the thickness of all four borders. You can provide 1, 2, 3, or 4 values to target different sides specifically.

It is documented as part of the CSS Backgrounds and Borders specification.

/* Usage Example */
.box {
  /* top | right | bottom | left */
  border-width: 2px 5px 2px 5px;
  border-style: solid;
  border-color: #333;
}

/* Global values */
border-width: inherit;
border-width: initial;
border-width: revert;
border-width: revert-layer;
border-width: unset;
Widely available Since 2015 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.

1+
1+
1+
12+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC