图像无法在IE 11上缩放

时间:2016-08-01 09:06:09

标签: html css internet-explorer responsive border-box

当我更改浏览器窗口的宽度时,图像不会在IE 11或更低版本上缩放。我与谷歌浏览器合作。我试图添加位置:绝对,但它破坏了整个布局。
图片css:

.auction-item-img-container {
  display: block;
  height: 400px;
  overflow: hidden;
  position: relative;
  width: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
@media screen and (max-width: 1024px ) {
  .auction-item-img-container {
    height: 0;
    padding-bottom: 100%;
  }
}
@media screen and (max-width: 480px ) {
  .auction-item-img-container {
    height: 270px;
  }
}

Parent和img都有display: block; box-sizing: border-box;
HTML:

<article onclick="AddCookieWithAuction(1185)" id="auction-1185">
<a class="auction-item-img-container" href="/Aukcje/PodgladAukcji/1185/1/1" style="background-image: url(/Content/images/backgrounds/empty.png)"> </a>
<!-- This part is responsive -->
<div class="auction-item-desc">
    <div class="auction-bar">
        <h4 class="auction-bar-author"><a href="/Aukcje/PodgladAukcji/1185/1/1">1</a></h4>
        <h5 class="auction-bar-title"><a href="/Aukcje/PodgladAukcji/1185/1/1">1</a></h5>
    </div>
    <div class="auction-price-container">
            <div class="actual-price-holder">
                    <span class="auction-price-label">Cena</span>

                <p class="auction-price"><a href="/Aukcje/PodgladAukcji/1185/1/1">123 PLN</a></p>
            </div>
                        <div class="auction-observe">
                <a onclick="acc.onObservedButtonClick(1185, this)" class="fa fa-star-o observe-icon"></a>
                <a onclick="acc.onObservedButtonClick(1185, this)" class="add-observe">Dodaj do obserwowanych</a>
            </div>
    </div>
    <div class="auction-type-container">
        <span class="auction-type"><a href="/Aukcje/PodgladAukcji/1185/1/1">Aukcja w trakcie</a></span>

    </div>
</div>
</article>

它在两种浏览器上的外观都是如此。 IMAGE

2 个答案:

答案 0 :(得分:0)

我建议您查看布局here和所有移动设备,您的网站在所有设备上都能正常运行。通过调整屏幕大小来监视Internet Explorer中的布局是没有意义的。

答案 1 :(得分:0)

可能会晚一点,但我找到了其他可能对你有帮助的答案:https://stackoverflow.com/a/42174237/1914261

  

IE11似乎对flex-shrink property的初始值有些麻烦。如果将其设置为零(最初设置为1),则应该可以正常工作