<svgviewBox="0 0 6 6"xmlns="http://www.w3.org/2000/svg"><!-- Effect of the (default) "butt" value --><linex1="1"y1="1"x2="5"y2="1"stroke="black"stroke-linecap="butt"/><!-- Effect of the "round" value --><linex1="1"y1="3"x2="5"y2="3"stroke="black"stroke-linecap="round"/><!-- Effect of the "square" value --><linex1="1"y1="5"x2="5"y2="5"stroke="black"stroke-linecap="square"/><!--
the following pink lines highlight the
position of the path for each stroke
--><pathd="M1,1 h4 M1,3 h4 M1,5 h4"stroke="pink"stroke-width="0.025"/></svg>
Usage notes
Value
butt | round | square
Default value
butt
Animatable
discrete
butt
The butt value indicates that the stroke for each subpath does not extend beyond its two endpoints. On a zero length subpath, the path will not be rendered at all.
Example
<svgviewBox="0 0 6 4"xmlns="http://www.w3.org/2000/svg"><!-- Effect of the "butt" value --><pathd="M1,1 h4"stroke="black"stroke-linecap="butt"/><!-- Effect of the "butt" value on a zero length path --><pathd="M3,3 h0"stroke="black"stroke-linecap="butt"/><!--
the following pink lines highlight the
position of the path for each stroke
--><pathd="M1,1 h4"stroke="pink"stroke-width="0.025"/><circlecx="1"cy="1"r="0.05"fill="pink"/><circlecx="5"cy="1"r="0.05"fill="pink"/><circlecx="3"cy="3"r="0.05"fill="pink"/></svg>
round
The round value indicates that at the end of each subpath the stroke will be extended by a half circle with a diameter equal to the stroke width. On a zero length subpath, the stroke consists of a full circle centered at the subpath's point.
Example
<svgviewBox="0 0 6 4"xmlns="http://www.w3.org/2000/svg"><!-- Effect of the "round" value --><pathd="M1,1 h4"stroke="black"stroke-linecap="round"/><!-- Effect of the "round" value on a zero length path --><pathd="M3,3 h0"stroke="black"stroke-linecap="round"/><!--
the following pink lines highlight the
position of the path for each stroke
--><pathd="M1,1 h4"stroke="pink"stroke-width="0.025"/><circlecx="1"cy="1"r="0.05"fill="pink"/><circlecx="5"cy="1"r="0.05"fill="pink"/><circlecx="3"cy="3"r="0.05"fill="pink"/></svg>
square
The square value indicates that at the end of each subpath the stroke will be extended by a rectangle with a width equal to half the width of the stroke and a height equal to the width of the stroke. On a zero length subpath, the stroke consists of a square with its width equal to the stroke width, centered at the subpath's point.
Example
<svgviewBox="0 0 6 4"xmlns="http://www.w3.org/2000/svg"><!-- Effect of the "square" value --><pathd="M1,1 h4"stroke="black"stroke-linecap="square"/><!-- Effect of the "square" value on a zero length path --><pathd="M3,3 h0"stroke="black"stroke-linecap="square"/><!--
the following pink lines highlight the
position of the path for each stroke
--><pathd="M1,1 h4"stroke="pink"stroke-width="0.025"/><circlecx="1"cy="1"r="0.05"fill="pink"/><circlecx="5"cy="1"r="0.05"fill="pink"/><circlecx="3"cy="3"r="0.05"fill="pink"/></svg>