Firefox将空白空间添加到SVG图像

时间:2018-05-23 18:51:14

标签: html css google-chrome firefox svg

我有一个HTML文档,我正在加载一个SVG图像,然后必须占据其容器的100%宽度。

但是有一个问题:当我在Firefox中加载页面时,它会在图像的左侧和右侧添加一些空白区域,从而使其看起来与其他内容不对齐,但是当我打开同一页面时在Chrome上,它按预期呈现。

Firefox截图: firefox
Chrome屏幕截图: enter image description here
这是我的代码:

body {
  padding: 0px 0px 0px 0px;
}

#container {
  padding-left: 5em;
  padding-right: 5em;
}

#logo {
  width: 100%;
  display: block;
}

.separator {
  width: 100%;
  height: 1px;
  background-color: black;
}
<div id="container">
  <img src="https://svgshare.com/i/6os.svg" id="logo">
  <br>
  <div class="separator"></div>
</div>

如何在Firefox上正确渲染?

0 个答案:

没有答案
相关问题