SVG being displayed differently on Chrome and Fire

2019-08-10 03:23发布

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

Chrome

Firefox

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条回答
Emotional °昔
2楼-- · 2019-08-10 03:52

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.

查看更多
登录 后发表回答