【发布时间】:2015-07-06 05:12:10
【问题描述】:
我已将 SVG 矩形放入 div:
<div id="box1">
<svg xmlns="http://www.w3.org/2000/svg" width="102px" height="171px">
<rect width="102px" height="171px" style="fill:#00ACEC; fill-opacity:1;"/>
</svg>
</div>
<div id="box2">
<svg xmlns="http://www.w3.org/2000/svg" width="162px" height="14px">
<rect width="162px" height="14px" style="fill:#BEBEBE; fill-opacity:1;"/>
</div>
两个矩形在底部正确对齐。
但是,如果我将高度降低 2px 并相应地更新顶部,则 svg rect 似乎向下移动,而它仍应像以前一样底部对齐。
请看这里:http://jsfiddle.net/mw1skze1/3/
问题发生在较小的矩形上。我是否遗漏了什么或者这是 svg 渲染的问题?
【问题讨论】: