我是一位非常新的设计师,创建了自己的WordPress主题,并且在FireFox、Chrome和Opera上正常工作。问题出现在InternetExplorer浏览器上(我使用的是Windows 7和IE 11)。
似乎InternetExplorer 11不理解max-width CSS属性。我有以下CSS代码:
.vi-container {
margin: 0 auto;
position: relative;
width: 100%;
}
.vi-content {
margin: 0 auto;
max-width: 1200px;
overflow: hidden;
}
HTML代码大致如下:
<div class="vi-container">
<header class="vi-header">Header stuff</header>
<main class="vi-content" itemtype="http://schema.org/Blog" itemprop="mainContentOfPage" itemscope="" role="main">
<article class="post-content-wrap" itemtype="http://schema.org/BlogPosting" itemprop="blogPost" itemscope=""></article>
<!-- more articles with contents -->
<aside class="vi-sidebar" itemtype="http://schema.org/WPSideBar" itemscope="" role="complementary"></aside>
</main>
</div>
在Internet Explorer中,max-width 1200px完全被忽略。您可以通过在IE和其他浏览器中加载我的网页来进行比较。例如:http://www.vozidea.com/limpia-la-base-de-datos-wordpress-con-wp-sweep
这里有一个JSfiddle示例:http://jsfiddle.net/z4s01yxz/
我在StackOverflow上找到了关于IE上max-width问题的其他文章,但无法自行修复,这就是为什么我请求帮助的原因。希望有人能给我帮助,非常感谢。
实际问题是在Internet Explorer中,网页会扩展以填充所有宽度,因为max-width被忽略了。您可以检查此图片以查看差异:i.imgur.com/kGr8wk1.jpg
P.S:对不起,我的英语不好。