CSS <line-width> Data Type
The <line-width> data type is the thickness of a line, written as a length or the keyword thin, medium or thick, used by borders and outlines.
Description
The <line-width> CSS data type represents the thickness of a line, such as a border, an outline or a column rule. It is used by border-width and its longhands, the border shorthands, outline-width and column-rule-width.
A <line-width> is either a non-negative <length>, such as 2px or 0.1em, or one of the keywords thin, medium and thick. The specification defines the keywords as 1px, 3px and 5px respectively, and modern browsers follow that. medium is the initial value of border-width, which is why border: solid on its own gives a 3px border. Percentages are not allowed.
Browsers round line widths to whole device pixels, so a very thin value such as 0.3px is usually drawn as one device pixel (or not at all when it is below that), and values never fall below that minimum once a visible border style is set.
Examples:
.subtle { border: thin solid #e2e8f0; }
.default { border-style: solid; } /* medium (3px) */
.heavy { border: thick double #0f172a; }
.focus { outline: 0.2em solid #2563eb; }
Interactive Demo
Syntax
<line-width> = <length [0,∞]> | thin | medium | thick
Values
- <length>A non-negative length, such as 2px or 0.1em.
- thinA thin line. Equivalent to 1px.
- mediumA medium line. Equivalent to 3px. This is the initial value for border widths.
- thickA thick line. Equivalent to 5px.
Example
Browser Support
The following information will show you the current browser support for the CSS line-width data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





