SVG being displayed differently on Chrome and Firefox

痴心易碎 提交于 2019-12-13 00:38:40

问题


I have one svg but it looks differently on Chrome and Firefox: http://codepen.io/anon/pen/OParwx.

svg {
  fill: black;
  stroke: black;
  width: 40px;
  height: 40px;
}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0,0,48.266,51.827">
  <g>
    <path d="M16.69 41.827c-2.763 0-4.975 2.237-4.975 5s2.212 5 4.975 5c2.763 0 5-2.237 5-5s-2.237-5-5-5"/>
    <path d="M40.19 41.827c-2.763 0-4.975 2.237-4.975 5s2.212 5 4.975 5c2.763 0 5-2.237 5-5s-2.237-5-5-5"/>
    <path d="M26.768 20v-20 20z" stroke-width="5" stroke-miterlimit="10" fill="none"/>
    <path d="M36.768 10h-20 20z" stroke-width="5" stroke-miterlimit="10" fill="none"/>
  </g>
  <g>
    <path d="M0 5.059h6.406l10.99 22.455h20.469l10.401-18.777" stroke-width="5" stroke-miterlimit="10" fill="none"/>
    <path d="M45 37.689h-29.947s-3.594.077-2.579-4.036l4.923-6.139" stroke-width="5" stroke-miterlimit="10" fill="none"/>
  </g>
</svg>

Here's how they look like

Chrome

Firefox

What makes them different and how to fix it?

Edit: a temporary solution (besides waiting for the bug is fixed on Firefox 37) is to remove stroke-miterlimit and add stroke-linejoin="bevel"


回答1:


You're suffering from bug 854296 It's a Windows only bug that will be fixed in Firefox 37 so not long to go now.



来源:https://stackoverflow.com/questions/29096688/svg-being-displayed-differently-on-chrome-and-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!