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

时间:2012-06-13 01:59:49

标签: css

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

网站全都乱成一团糟。我想再试一次。

如何将内容框置于Internet Explorer和Mozilla的中心?

CSS代码style_sample.css

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

1 个答案:

答案 0 :(得分:2)

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

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

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

enter image description here

如果您添加<!doctype html>声明以将其投入标准模式(我可以通过将浏览器更改为标准模式来模拟):

enter image description here

页面然后对我来说很好。


Internet Explorer(Quirks模式)
enter image description here

Internet Explorer
enter image description here

<强>铬
enter image description here

相关问题