IE6 Auto margin works? How is this possible?

こ雲淡風輕ζ 提交于 2019-12-11 12:36:27

问题


I'm just a bit CSSing, and I have this code:

#page
{
    width: 950px;
    margin: 0px auto;
}

I have a div with id="page". I opened my page in IE6, and it just worked. Since when do auto margins work in IE6? Can somebody explain me why it works? Thanks

BTW my doctype is:

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

回答1:


IE6 does support centering via margin:auto, as long as the document is in standards mode not quirks mode.

IE6 was the first IE version to support it.



来源:https://stackoverflow.com/questions/1181862/ie6-auto-margin-works-how-is-this-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!