【问题标题】:The confusing about html document type in IE6IE6中关于html文档类型的困惑
【发布时间】:2011-04-25 09:27:21
【问题描述】:

它总是说css代码margin:0 auto;不能让元素在IE6中居中

但我发现如果我在html代码中设置文档类型,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

当我创建 html 页面时在 Visual Studio 2010 中自动创建的

margin:0 auto; 可以让 html 元素在 IE6 中再次居中

那么为什么文档类型会起作用?这个文档到底是什么意思?

谢谢

【问题讨论】:

    标签: types internet-explorer-6 document


    【解决方案1】:

    浏览器根据 doctype 声明的存在在标准和 quirks mode 之间切换。 Quirks 模式是一种向后兼容模式,它模仿旧浏览器的行为。这样做是为了适应依赖早期浏览器的非标准行为的页面。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-11
      • 2021-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-21
      相关资源
      最近更新 更多