CSS border-width Property
Description
The border-width property determines the visual thickness of an element’s border area and therefore how much space the border occupies around content. Changing border thickness alters the element’s frame and can affect perceived emphasis and separation between elements: thicker borders draw more attention and create a stronger visual boundary, while thinner borders are subtler. Because borders are part of the element’s painted box, their thickness is an important design tool for hierarchy, focus states and visual rhythm in UI layouts.
Although border thickness itself does not inherit from parent elements, it participates directly in the box model and therefore influences layout calculations. When an element’s box sizing model differs, the way border thickness contributes to the element’s overall dimensions can change - see box-sizing for details on that relationship. Developers should be mindful that increasing border thickness can push nearby layout or require compensating adjustments to padding and content size to preserve intended spacing.
The appearance and visibility of the border thickness are meaningful only when the element’s border style is such that a border is drawn; the interaction with border-style determines whether the thickness will be rendered at all, and border-color controls its hue. Many authors choose to manage width together with color and style via the shorthand border, which can simplify declarations while keeping the relationship between those properties explicit. Also note that rounded corners created by border-radius visually clip or soften the border’s outer edges, so thickness interacts with corner radii to determine the final outline shape.
Beyond aesthetics, border thickness can affect hit-testing and the effective touch target of elements on interactive interfaces: a larger border increases the clickable area if padding and content sizes remain constant. From a rendering perspective, extreme or frequently changing border thicknesses can also influence repaint costs in dynamic UIs, so it’s worth considering performance when animating or toggling border dimensions.
Definition
- Initial value
- See individual properties
- Applies to
- All elements
- Inherited
- No
- Computed value
- See individual properties
- Animatable
- Yes
- JavaScript syntax
- object.style.borderWidth
Interactive Demo
Syntax
border-width: <line-width>{1,4}
Values
- thinLess than the default width.
- mediumDefault value.
- thickGreater than the default width.
- <length>Floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px).
- inherit
Example
Browser Support
The following information will show you the current browser support for the CSS border-width property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
