实例:https://codepen.io/Ni55aN/pen/jJGVYe
svg {
overflow: visible !important;
}
.cont {
position: absolute;
top: 0;
left: 0;
}
svg .main-path {
fill: none;
stroke-width: 5px;
stroke: steelblue;
}
.invalid {
width: 1px;
height: 1px;
}
.invalid .main-path {
stroke: red;
}
相同的路径放在不同的 SVG 中。 SVG 放置在具有绝对位置的容器中。路径应该在视觉上匹配,但我们在 SVG 中遇到了 1px 高度和宽度的问题 - 路径被移动(可能缩放)。
为什么会这样?这是一个错误吗?以及如何解决这个问题,让 SVG 本身不占用任何区域
最佳答案
关于html - 宽度和高度等于 1px 的 Svg 路径位置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55110988/