简体   繁体   English

flexbox中的SVG在IE11中无法正确缩放

[英]SVG within flexbox doesn't scale properly in IE11

On my website I've got several blocks with svg images and text desription. 在我的网站上,我有几个带有svg图像和文本描述的块。 I want them to be flexboxes so I can easily align text vertically like in this example: 我希望它们是flexboxes,所以我可以像这个例子一样轻松地垂直对齐文本:

<div class="decorated-feature">                        
  <div class="feature-decorator feature-image">
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 356.8 357.2"  xml:space="preserve">
      <style type="text/css">
        .st0 {
          fill: none;
          stroke: black;
          stroke-width: 4;
          stroke-linecap: round;
          stroke-linejoin: round;
          stroke-miterlimit: 10;
        }
      </style>
      <path class="st0" d="M178.3,2C80.9,2,2,80,2,177.4s79,177.8,176.4,177.8s176.4-76.9,176.4-174.9" />
      <polyline class="st0" points="261.2,76 178.4,176.5 132.7,132.7" />
    </svg>
  </div>
  <div class="feature-description right-text">
    <h3>Dolor sit</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.s.</p>
  </div>
</div>
</div>

I want an image to be 30% width of the containing div and scale to preserve it's ratio like in this codepen http://codepen.io/anon/pen/LkrAVP . 我想要一个图像是包含div的30%宽度和比例,以保持它的比例,就像在这个codepen http://codepen.io/anon/pen/LkrAVP It works fine in all browsers except IE11. 它在除IE11之外的所有浏览器中都能正常工作 Is that some kind of bug? 那是某种虫子吗? What can I do to support it? 我该怎么做才能支持它?

EDIT: It turns out that it is general problem with scaling inline svg images. 编辑:事实证明,缩放内联svg图像是一般问题。 I used a wrapper container with padding so that the svg scale properly as described in this article https://css-tricks.com/scale-svg/ which covers topic in details. 我使用了带填充的包装容器,以便svg正确缩放,如本文所述https://css-tricks.com/scale-svg/ ,其中详细介绍了主题。

As per caniuse.com , IE11 partially supports flex property due to large amount of bugs present. 根据caniuse.com ,由于存在大量错误,IE11 部分支持flex属性。

See Known issues section on https://caniuse.com/#search=flex 请参阅https://caniuse.com/#search=flex上的已知问题部分

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM