浏览器兼容性布局中心之战:IE和Mozilla

问题描述 投票:0回答:1

因此,基于以前的帮助,将margin: 0 auto放在容器上并删除内容框上的所有边距属性在Mozilla Firefox中完美运行,但Internet Explorer是一场灾难。

它变得非常糟糕,以至于网站全都被打乱了。我想再试一次。

如何在Internet Explorer和Mozilla上集中内容框?

CSS代码:style_sample.css

网页:http://avisuals.web.fc2.com/sample.html

css
1个回答
2
投票

该页面没有doctype声明,例如:

<!doctype html>    
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

因此,浏览器被抛入Internet 5.5 / Netscape / 1998兼容性/怪癖模式:

如果你添加<!doctype html>声明把它扔进标准模式(我可以通过将浏览器更改为标准模式来模拟):

然后该页面对我来说很好。


Internet Explorer(Quirks模式):

IE浏览器:

铬:

© www.soinside.com 2019 - 2024. All rights reserved.