简体   繁体   English

调整浏览器大小时,SVG 顶部有空白

[英]SVG has white space on top when resizing the browser

When I resize the browser a thin white line appears at the top of the SVG.当我调整浏览器大小时,SVG 顶部会出现一条细白线。 If I resize the page again, it disappears.如果我再次调整页面大小,它就会消失。 At certain page widths it reappears and disappears.在某些页面宽度下,它会重新出现和消失。 When I open the SVG file by itself, I don't see any artifacts like that.当我自己打开 SVG 文件时,我看不到任何类似的工件。 When I set the SVG background to something crazy like background: red I can see that the white line is inside the SVG because it turns red, and not some kind of border or artifact created by a neighboring div.当我将 SVG 背景设置为类似background: red我可以看到白线在 SVG 内部,因为它变成红色,而不是由相邻 div 创建的某种边界或伪影。 Any ideas on why this might be?关于为什么会这样的任何想法? So far I've only been able to reproduce it in Chrome and Microsoft Edge.到目前为止,我只能在 Chrome 和 Microsoft Edge 中重现它。 It looks fine in FF and Safari.在 FF 和 Safari 中看起来不错。

This is the page the SVG is on: https://striveworks.us/careers这是 SVG 所在的页面: https://striveworks.us/careers

here's an example:这是一个例子:

这是工件的示例

Your issue is with this, if you disable the background via inspect-elements, the line will disappear, but then the bottom part will be mis-colored.您的问题是,如果您通过检查元素禁用背景,则该行将消失,但底部将颜色错误。

svg.careers__AnimatedCurveSVG-sc-1587ytp-2 hwGnAC.hwGnAC {
    background: rgb(244, 242, 246);
}

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM