Reputation: 3481
How to remove the line between two adjacent polygons in SVG:
<svg width="200px" height="200px" viewBox="0 0 200 200">
<polygon points="100 100, 100 200, 200 100" style="fill: blue; fill-opacity: 1; stroke: black;stroke-width: 0;" />
<polygon points="200 200, 100 200, 200 100" style="fill: blue; fill-opacity: 1; stroke: black;stroke-width: 0;" />
</svg>
In this case it could be solved by merging the two polygons - but this is not the case if the polygons has different colors.
Upvotes: 1
Views: 671
Reputation: 124059
It's antialiasing so shape-rendering="crispEdges" would be one way to fix it.
<svg width="200px" height="200px" viewBox="0 0 200 200" shape-rendering="crispEdges">
<polygon points="100 100, 100 200, 200 100" style="fill: blue; fill-opacity: 1; stroke: black;stroke-width: 0;" />
<polygon points="200 200, 100 200, 200 100" style="fill: blue; fill-opacity: 1; stroke: black;stroke-width: 0;" />
</svg>
Upvotes: 5