property

Stroke width — CSS reference

Sets stroke thickness in the current user coordinate system. A percentage uses the normalized viewport diagonal. A 12-unit stroke on a straight path extends six units to each side.

Formal Syntax & Structure

css syntaxcss
stroke-width: 12px;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>stroke-width</title><style>body{margin:0;background:white}svg{display:block}#a{stroke-width:12px}</style><body><svg xmlns="http://www.w3.org/2000/svg" width="240" height="160" viewBox="0 0 240 160" role="img" aria-label="SVG styling example"><path id="a" d="M40 80 H180" fill="none" stroke="red" stroke-width="10"/></svg></body></html>
CSS Reference