【发布时间】:2020-10-07 13:20:49
【问题描述】:
我的 HTML 页面上有一个 SVG 图像,它周围有一个非常细的边框(在底部显示为水平线)。
我已尝试移除边框。
我已将 SVG 引用为图像标签中的外部文件
HTML 文件
<img class="svgfix" src="img/home_footer_header.svg" alt="" width="100%" />
SVG 文件
<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="237.239" viewBox="0 0 1920 237.239">
<g id="HomeFooter_Seperater" transform="translate(0 -1767.761)">
<rect id="Rectangle_610"
data-name="Rectangle 610"
width="1920"
height="122"
transform="translate(0 1883)"
style="fill:rgb(58,58,58)"
fill="#3a3a3a" />
<path id="Seperator_Black" d="M-2652,3221.992l1920-86.4v141.95l-1920,85.376Z" transform="translate(2652 -1367.826)"/>
</g>
</svg>
尝试修复
img.svgfix {
border: 0;
background-clip: padding-box;
color: transparent;
}
【问题讨论】: