简体   繁体   English

IE11 中的布局中断,但在 Chrome 中工作正常

[英]Layout break in IE11 but in Chrome works fine

I have this archive in my site and works fine.我的网站上有这个存档并且工作正常。 But when I open it in IE11 the image is not resized.但是当我在 IE11 中打开它时,图像没有调整大小。

in Chrome:在 Chrome 中: 1

in IE11:在 IE11 中: 在此处输入图像描述

My code:我的代码:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<div class="container">
  <ul class="nav nav-tabs">
    <li class="active"><a data-toggle="tab" href="#img">Img 1</a></li>
    <li><a data-toggle="tab" href="#imgg">Img 2</a></li>
    <li><a data-toggle="tab" href="#imge">Img 3</a></li>
    <li><a data-toggle="tab" href="#imgee">Img 4</a></li>
  </ul>

  <div class="tab-content">
    <div id="img" class="tab-pane fade in active">
      <img src='img1.png' width="90%" />
    </div>
    <div id="imgg" class="tab-pane fade">
      <img src='img2.png' width="90%" />
    </div>
    <div id="imge" class="tab-pane fade">
      <img src='img3.png' width="90%" />
    </div>
    <div id="imgee" class="tab-pane fade">
      <img src='img4.png' width="90%" />
    </div>
  </div>
</div>

<style>
  .tab-pane {
    margin-top: 10px;
  }
</style>

Someone know why the img breaks in IE11?有人知道为什么 img 在 IE11 中会中断吗?

I have created a sample using your code, it seems that everything works well in IE browser, the screenshot like this .我已经使用您的代码创建了一个示例,似乎在 IE 浏览器中一切正常,截图如下 Please check your code, whether there have any other CSS style?请检查您的代码,是否还有其他 CSS 样式?

Besides,try to clear the browser data (such as:cache), and then you could try to use F12 developer tools to check the HTML elements and CSS style.此外,尝试清除浏览器数据(如:缓存),然后您可以尝试使用F12开发工具检查HTML元素和CSS样式。 Then, try to set the div container width property.然后,尝试设置 div 容器的宽度属性。 such as:如:

<style>
    .tab-pane {
        margin-top: 10px;
    }
    .container{
        width:90%;
    }
</style>

IE11 screen width isn't supported .支持IE11 屏幕宽度。

You can use css rules in order to achieve that like so:您可以使用 css 规则来实现,如下所示:

.tab-pane img{
  width: 90%;

} }

Don't forget to remove the inline property from your img tags.不要忘记从你的 img 标签中删除 inline 属性。

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

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