CSS stroke-linejoin Property
The CSS stroke-linejoin property defines the shape of the corners where two connected segments of an SVG stroke meet.
It controls whether corners appear pointed, rounded, or beveled. The property is useful for SVG icons, diagrams, illustrations, and geometric shapes. It works with stroke-width and stroke-miterlimit to control the appearance of stroked corners.
stroke-linejoin Syntax
The stroke-linejoin property accepts a keyword describing the shape of the join between connected stroke segments.
Basic Syntax
svg path {
stroke-linejoin: round;
}
Available Values
svg path {
stroke-linejoin: miter;
}
svg path {
stroke-linejoin: round;
}
svg path {
stroke-linejoin: bevel;
}
svg path {
stroke-linejoin: miter-clip;
}
svg path {
stroke-linejoin: arcs;
}
The traditional values are miter, round, and bevel. SVG 2 also defines miter-clip and arcs, but browser support for these additional values is limited.
CSS-Wide Keywords
svg path {
stroke-linejoin: initial;
}
svg path {
stroke-linejoin: inherit;
}
svg path {
stroke-linejoin: unset;
}
svg path {
stroke-linejoin: revert;
}
svg path {
stroke-linejoin: revert-layer;
}
The initial value is miter, which extends the outer edges of connected stroke segments until they meet at a pointed corner.
Property Values
| Value | Description |
|---|---|
miter |
Extends the outer stroke edges until they meet at a point. The join is limited by stroke-miterlimit. This is the initial value. |
round |
Creates a rounded corner using a circular arc centered at the join. |
bevel |
Creates a flattened corner by connecting the outer edges of the stroke. |
miter-clip |
Creates a miter join but clips the pointed extension when it exceeds the miter limit. Browser support is limited. |
arcs |
Creates a join using an arc based on the geometry of the connected segments. Browser support is limited. |
initial |
Resets the property to miter. |
inherit |
Uses the computed line join value from the parent element. |
unset |
Uses the inherited value because the property is inherited. |
revert |
Reverts the property according to CSS cascade origin rules. |
revert-layer |
Reverts the property according to CSS cascade layer rules. |
Property Characteristics
| Characteristic | Value |
|---|---|
| Initial value | miter |
| Inherited | Yes |
| Applies to | Applicable SVG shapes, paths, and text elements |
| Computed value | As specified |
| Animation type | Discrete |
| Percentages | Not applicable |
| Related properties | stroke, stroke-width, stroke-linecap, stroke-miterlimit |
| Specification | SVG 2 |
Valid Examples
svg path {
stroke-linejoin: miter;
}
svg polygon {
stroke-linejoin: round;
}
svg polyline {
stroke-linejoin: bevel;
}
svg path {
stroke-linejoin: miter-clip;
}
svg path {
stroke-linejoin: arcs;
}
The last two values are defined by SVG 2 but should not be relied upon without checking browser support.
Invalid Examples
svg path {
stroke-linejoin: square;
}
svg path {
stroke-linejoin: rounded;
}
svg path {
stroke-linejoin: 10px;
}
svg path {
stroke-linejoin: 50%;
}
svg path {
stroke-linejoin: round bevel;
}
The property accepts one supported keyword. Lengths, percentages, multiple values, and unsupported keywords are invalid.
How It Works
When two connected segments of an SVG path meet at an angle, their strokes create a corner. The stroke-linejoin property determines how the outer portion of that corner is painted.
Step 1: Create a Path With a Corner
<svg viewBox="0 0 240 140">
<path d="M30 110 L120 30 L210 110"/>
</svg>
The path contains two connected line segments that meet at an upper corner.
Step 2: Define the Stroke
path {
fill: none;
stroke: #2563eb;
stroke-width: 16;
}
The path now has a thick blue stroke. The corner uses the default miter join.
Step 3: Change the Join
path {
fill: none;
stroke: #2563eb;
stroke-width: 16;
stroke-linejoin: round;
}
The pointed corner becomes rounded without changing the underlying path coordinates.
Complete SVG Example
<svg viewBox="0 0 240 140" role="img" aria-label="Blue angled path with a rounded corner">
<path d="M30 110 L120 30 L210 110" fill="none" stroke="#2563eb" stroke-width="16" stroke-linejoin="round"/>
</svg>
Important Consideration
The property changes the painted shape of a corner, not the actual geometry of the SVG path. The coordinates and direction of the connected segments remain unchanged.
Comparing Line Join Values
Different line join values produce different corner shapes, particularly when the stroke is thick or the angle between segments is sharp.
miter
.miter-join {
stroke-linejoin: miter;
}
The outer edges of the stroke extend until they intersect, forming a pointed corner. Sharper angles can create longer extensions.
round
.round-join {
stroke-linejoin: round;
}
The corner is rounded using a circular arc. This produces a softer appearance without a sharp extension.
bevel
.bevel-join {
stroke-linejoin: bevel;
}
The outer corner is flattened with a straight edge connecting the outer stroke boundaries.
miter-clip
.clipped-miter {
stroke-linejoin: miter-clip;
stroke-miterlimit: 3;
}
This value retains the miter shape but clips an excessively long extension rather than switching to a bevel join. Support is limited.
arcs
.arc-join {
stroke-linejoin: arcs;
}
This SVG 2 value constructs a curved join using the geometry of the connected stroke segments. It differs from the circular rounding produced by round and has limited browser support.
Value Comparison
| Value | Corner Appearance | Miter Limit Effect |
|---|---|---|
miter |
Pointed | Changes to bevel when the limit is exceeded |
round |
Rounded | Not affected |
bevel |
Flattened | Not affected |
miter-clip |
Pointed or clipped | Clips the extension at the limit |
arcs |
Curved | Limits the join extension according to SVG 2 rules |
For consistent results across browsers, use miter, round, or bevel.
Using stroke-miterlimit
The stroke-miterlimit property controls how far a miter join may extend beyond a corner before the browser applies a limit.
Basic Miter Join
.pointed-corner {
stroke-linejoin: miter;
stroke-miterlimit: 4;
}
The default miter limit is 4. It limits excessively long pointed corners.
Increasing the Miter Limit
.long-miter {
stroke-linejoin: miter;
stroke-miterlimit: 10;
}
A higher limit allows longer pointed joins at sharper angles.
Reducing the Miter Limit
.short-miter {
stroke-linejoin: miter;
stroke-miterlimit: 2;
}
A lower limit causes more sharp corners to use a bevel join.
How the Limit Works
The miter limit compares the miter length with the stroke width. As the corner becomes sharper, the miter length increases.
When the ratio exceeds the limit, a miter join is rendered as a bevel join.
Miter vs. Miter-Clip
.standard-miter {
stroke-linejoin: miter;
stroke-miterlimit: 3;
}
.clipped-miter {
stroke-linejoin: miter-clip;
stroke-miterlimit: 3;
}
With miter, exceeding the limit produces a bevel. With miter-clip, the extension is clipped at the limit. The latter value has limited browser support.
Important Consideration
The miter limit does not affect round or bevel joins. It is primarily relevant to miter and miter-clip.
Line Joins and Stroke Width
The appearance of a line join becomes more noticeable as the stroke width increases.
Thin Stroke
.thin-corner {
fill: none;
stroke: #2563eb;
stroke-width: 2;
stroke-linejoin: round;
}
With a thin stroke, differences between corner styles may be difficult to see.
Thick Stroke
.thick-corner {
fill: none;
stroke: #2563eb;
stroke-width: 20;
stroke-linejoin: round;
}
With a thick stroke, the rounded corner becomes more prominent.
Sharp Miter Corners
.sharp-corner {
fill: none;
stroke: #a855f7;
stroke-width: 20;
stroke-linejoin: miter;
stroke-miterlimit: 10;
}
Thick strokes combined with sharp angles can produce long miter extensions.
Preventing Clipping
Long miter joins may extend outside the SVG viewport. Leave sufficient space around the shape or adjust the viewBox when necessary.
Important Consideration
Changing stroke-width affects the size of the painted join, but it does not change the underlying corner angle or path coordinates.
Open and Closed Paths
The stroke-linejoin property affects corners in both open and closed SVG paths.
Open Polyline
<polyline points="20,100 100,20 180,100" fill="none" stroke="#2563eb" stroke-width="12" stroke-linejoin="round"/>
The corner at the middle point receives a rounded join. The two open endpoints are controlled separately by stroke-linecap.
Closed Polygon
<polygon points="100,15 185,150 15,150" fill="none" stroke="#0d9488" stroke-width="12" stroke-linejoin="bevel"/>
All three corners receive beveled joins because the polygon forms a closed shape.
Rectangle
<rect x="20" y="20" width="160" height="100" fill="none" stroke="#a855f7" stroke-width="12" stroke-linejoin="round"/>
The rectangle's stroke corners are rounded, even though the rectangle's underlying geometry remains unchanged.
Single Straight Line
<line x1="20" y1="50" x2="180" y2="50" stroke="#2563eb" stroke-width="12" stroke-linejoin="round"/>
A single straight line has no corner where connected segments meet, so stroke-linejoin has no visible effect.
Curved Paths
Smooth curves generally do not produce sharp joins along their continuous sections. The property becomes relevant where path segments meet with a change in direction.
stroke-linejoin vs. stroke-linecap
Although both properties affect SVG stroke geometry, they control different parts of a path.
| Property | Controls | Values |
|---|---|---|
stroke-linejoin |
Corners where connected stroke segments meet | miter, round, bevel, miter-clip, arcs |
stroke-linecap |
Open endpoints and individual dash ends | butt, round, square |
Rounded Endpoints and Corners
.rounded-outline {
fill: none;
stroke: #2563eb;
stroke-width: 10;
stroke-linecap: round;
stroke-linejoin: round;
}
Creates rounded endpoints and rounded corners on an open path.
Square Endpoints and Beveled Corners
.angular-outline {
fill: none;
stroke: #a855f7;
stroke-width: 10;
stroke-linecap: square;
stroke-linejoin: bevel;
}
Creates square extensions at open endpoints and flattened corners between connected segments.
Important Consideration
Changing stroke-linejoin does not change the appearance of open endpoints. Use stroke-linecap when endpoint styling is required.
Practical Examples
Rounded SVG Icon
.rounded-icon path {
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
Creates smooth corners and endpoints for line-based SVG icons.
Sharp Geometric Outline
.geometric-outline {
fill: none;
stroke: #2563eb;
stroke-width: 6;
stroke-linejoin: miter;
stroke-miterlimit: 4;
}
Preserves pointed corners while limiting excessive extensions.
Beveled Polygon
.beveled-polygon {
fill: none;
stroke: #0d9488;
stroke-width: 12;
stroke-linejoin: bevel;
}
Creates flattened corners on an SVG polygon.
Rounded Rectangle Stroke
.rounded-rectangle-stroke {
fill: none;
stroke: #a855f7;
stroke-width: 10;
stroke-linejoin: round;
}
Rounds the painted stroke corners without changing the rectangle's geometry.
High Miter Limit
.extended-miter {
fill: none;
stroke: #ec4899;
stroke-width: 10;
stroke-linejoin: miter;
stroke-miterlimit: 10;
}
Allows longer pointed joins at sharp corners.
Inherited Line Joins
.svg-group {
stroke: #2563eb;
stroke-width: 6;
stroke-linejoin: round;
}
Child SVG elements inherit rounded joins unless they specify another value.
Reset Line Joins
.default-joins {
stroke-linejoin: initial;
}
Restores the initial miter value.
stroke-linejoin Example
This example compares miter, round, and bevel using three identical angled SVG paths. The same stroke width and path geometry make the corner differences easy to see.
HTML Example
<div class="stroke-linejoin-demo">
<svg viewBox="0 0 600 200" role="img" aria-label="Three angled SVG paths comparing pointed, rounded, and beveled corners">
<path class="join-miter" d="M30 150 L100 40 L170 150"/>
<path class="join-round" d="M230 150 L300 40 L370 150"/>
<path class="join-bevel" d="M430 150 L500 40 L570 150"/>
</svg>
</div>
CSS Example
.stroke-linejoin-demo svg {
display: block;
width: 100%;
height: auto;
}
.stroke-linejoin-demo path {
fill: none;
stroke-width: 24;
stroke-linecap: butt;
}
.stroke-linejoin-demo .join-miter {
stroke: #2563eb;
stroke-linejoin: miter;
}
.stroke-linejoin-demo .join-round {
stroke: #0d9488;
stroke-linejoin: round;
}
.stroke-linejoin-demo .join-bevel {
stroke: #a855f7;
stroke-linejoin: bevel;
}
The blue path has a pointed miter join, the teal path has a rounded join, and the purple path has a flattened bevel join.
Comparing the Results
| Path | Value | Corner Appearance |
|---|---|---|
| Blue | miter |
Pointed corner |
| Teal | round |
Rounded corner |
| Purple | bevel |
Flattened corner |
Increasing the Stroke Width
.stroke-linejoin-demo path {
stroke-width: 32;
}
A thicker stroke makes the differences between the three join styles more noticeable.
Changing the Miter Limit
.stroke-linejoin-demo .join-miter {
stroke-miterlimit: 1;
}
The low miter limit causes the blue path's pointed corner to use a bevel join.
Changing All Joins to Round
.stroke-linejoin-demo .join-miter,
.stroke-linejoin-demo .join-round,
.stroke-linejoin-demo .join-bevel {
stroke-linejoin: round;
}
All three paths now use rounded corners.
Adding Rounded Endpoints
.stroke-linejoin-demo path {
stroke-linecap: round;
}
The open endpoints become rounded while each path retains its selected corner style.
Accessibility Considerations
Line join styles affect the appearance of SVG outlines and can influence how clearly corners and shapes are perceived.
Maintain Sufficient Contrast
Ensure that SVG strokes remain visible against their backgrounds, especially when thin outlines are used.
Avoid Excessively Sharp Extensions
Long miter joins can make small graphics appear distorted or difficult to interpret. Use an appropriate miter limit.
Choose Appropriate Stroke Widths
Very thin strokes may make join differences difficult to recognize. Test icons and diagrams at their intended display sizes.
Provide Accessible SVG Names
Informative SVG graphics should include accessible names or equivalent descriptions.
<svg viewBox="0 0 200 120" role="img" aria-label="Blue angled line with a rounded corner">
<path d="M20 100 L100 20 L180 100" fill="none" stroke="blue" stroke-width="10" stroke-linejoin="round"/>
</svg>
Avoid Style-Only Meaning
Do not rely solely on corner shape to communicate important information. Provide labels or additional visual cues when necessary.
Test Zoom and Scaling
Verify that rounded, beveled, and pointed corners remain recognizable when SVG graphics are resized or zoomed.
Common Mistakes
Using Unsupported Keywords
svg path {
stroke-linejoin: rounded;
}
The correct keyword is round, not rounded.
Using square as a Join Value
svg path {
stroke-linejoin: square;
}
The square keyword belongs to stroke-linecap, not stroke-linejoin.
Confusing Line Joins With Line Caps
Line joins control corners. Line caps control open endpoints and individual dash ends.
Expecting a Join on a Straight Line
A single straight line has no corner where connected segments meet, so changing stroke-linejoin has no visible effect.
Forgetting to Define a Stroke
The initial stroke value is none. Line joins are not visible unless the element has a painted stroke.
Using an Excessively High Miter Limit
High miter limits can produce long pointed extensions at sharp angles. Use a suitable limit to prevent unwanted spikes.
Expecting stroke-miterlimit to Affect Round Joins
The miter limit does not change the appearance of round or bevel joins.
Assuming All SVG 2 Values Have Equal Support
The miter-clip and arcs values have limited browser support. Use widely supported values when compatibility is important.
Ignoring Viewport Clipping
Long miter extensions can extend outside the SVG viewport and become clipped.
Expecting Smooth Value Transitions
The property animates discretely. Changes between join keywords do not smoothly interpolate the corner shape.
Important Considerations
Keep the following points in mind when using stroke-linejoin:
- It controls the shape of corners where connected SVG stroke segments meet.
- The initial value is
miter. - The property is inherited.
- The widely supported values are
miter,round, andbevel. - SVG 2 also defines
miter-clipandarcs. - The additional SVG 2 values have limited browser support.
- The
mitervalue creates pointed corners. - The
roundvalue creates rounded corners. - The
bevelvalue creates flattened corners. - The
miter-clipvalue clips excessive miter extensions. - The
arcsvalue uses curved join geometry. - The
stroke-miterlimitproperty limits pointed miter extensions. - The default miter limit is
4. - Sharp angles can create long miter extensions.
- Thicker strokes make join differences more noticeable.
- The property affects both open and closed paths with corners.
- It has no visible effect on a single straight line.
- It does not change the underlying path coordinates.
- The
stroke-linecapproperty controls endpoints, not corners. - The property animates discretely.
- A painted stroke is required for joins to be visible.
- Long joins may be clipped by SVG viewport boundaries.
- Test corner appearance across supported browsers and display sizes.
Browser Support
The CSS stroke-linejoin property is widely supported for SVG graphics in modern browsers, including Chrome, Edge, Firefox, and Safari.
The miter, round, and bevel values have broad browser support. The SVG 2 values miter-clip and arcs have limited support and should be tested before use.
For current compatibility information, visit Can I Use? and search for stroke-linejoin.
Feature Detection
@supports (stroke-linejoin: round) {
.rounded-corners {
stroke-linejoin: round;
}
}
Feature queries can test whether a browser recognizes the property and value syntax.
Fallback for Advanced Values
.advanced-join {
stroke-linejoin: bevel;
stroke-linejoin: miter-clip;
}
Browsers that do not recognize miter-clip ignore that declaration and retain the preceding bevel value. Recognition of the keyword does not necessarily guarantee complete rendering support.
Fallback Behavior
If a declaration is invalid or unsupported, the browser ignores it. The element uses another applicable value from the cascade or its inherited value, falling back to miter when no other value applies.
Testing Recommendations
Test thick strokes, sharp angles, miter limits, closed shapes, and advanced join values in the browsers you support.
Specifications
The stroke-linejoin property is defined in the SVG 2 specification.
SVG 2 - stroke-linejoin Property
The specification defines the geometry of stroke joins and their interaction with stroke-miterlimit.
For additional documentation and examples, consult MDN Web Docs.
