svg 和其他元素之间的白线

KSP*_*SPR 5 html css svg google-chrome

我有非常简单的 svg,只有一种颜色和三个多边形点。

在 Chrome 中,某些宽度的 svg 之前有一条不应该存在的白线:

在此输入图像描述

顶部有一个具有相同颜色的 div。svg 甚至与具有相同颜色的 div 重叠,margin-bottom -10px;但白线始终出现:

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     viewBox="0 0 1920 145" style="enable-background:new 0 0 1920 145;" xml:space="preserve">
<style type="text/css">
    .st0{fill:#262120;}
</style>
<g>
    <polygon class="st0" points="1920,145 0,0 1920,0    "/>
</g>
</svg>
Run Code Online (Sandbox Code Playgroud)

这里有什么问题?

小智 1

这可能是因为所有 html 元素在 css 中都设置了正常的行高。

\n
line-height: 0; \n
Run Code Online (Sandbox Code Playgroud)\n

可以解决这个问题\xe2\x80\x8d\xe2\x99\x82\xef\xb8\x8f

\n