簡體   English   中英

flexbox中的SVG在IE11中無法正確縮放

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

在我的網站上,我有幾個帶有svg圖像和文本描述的塊。 我希望它們是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>

我想要一個圖像是包含div的30%寬度和比例,以保持它的比例,就像在這個codepen http://codepen.io/anon/pen/LkrAVP 它在除IE11之外的所有瀏覽器中都能正常工作 那是某種蟲子嗎? 我該怎么做才能支持它?

編輯:事實證明,縮放內聯svg圖像是一般問題。 我使用了帶填充的包裝容器,以便svg正確縮放,如本文所述https://css-tricks.com/scale-svg/ ,其中詳細介紹了主題。

根據caniuse.com ,由於存在大量錯誤,IE11 部分支持flex屬性。

請參閱https://caniuse.com/#search=flex上的已知問題部分

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM