【发布时间】:2015-05-01 21:57:50
【问题描述】:
我是一个非常新的设计师,创建了自己的 WordPress 主题,它可以在 FireFox、Chrome 和 Opera 上按预期工作。 InternetExplorer 出现了问题(我使用的是带有 IE 11 的 Windows 7)。
似乎 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>
最大宽度 1200px 完全被 InternetExplorer 忽略。您可以在 IE 和其他浏览器中实时加载我的网页进行比较。例如:http://www.vozidea.com/limpia-la-base-de-datos-wordpress-con-wp-sweep
这里有一个 JSfiddle 示例:http://jsfiddle.net/z4s01yxz/
我在 StackOverflow 中找到了其他关于 IE 上最大宽度问题的文章,但我自己无法修复,这就是我请求帮助的原因。希望有人能帮帮我,在此先感谢。
实际的问题是,在 InternetExplorer 中,由于忽略了 max-width,因此网页会扩展以填充所有宽度。您可以查看此图像以查看差异:i.imgur.com/kGr8wk1.jpg
P.S:对不起,我的英语不好。
【问题讨论】:
-
请说明实际问题是什么(忽略是不够的)并提供代码示例在问题中进行演示。站外链接是不够的。
-
完成@Paulie_D,我添加了更多信息、示例代码和屏幕。希望这已经足够了。
标签: html css internet-explorer