我正在我的网站上工作 http://bookmyshirt.co.cc/help/index.html但它的背景在 Internet Explorer 中不一致,但在 Firefox 中运行良好。 请帮帮我。
最佳答案
尝试添加 DocType。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
我也看过你的风格。如果您替换#maincontainer 上的样式:
left: -480px;
margin-left: 50%;
position: relative
与
margin:0 auto;
width: 960px;
一切都应该排队。如果没有,请使用 IE 的 developer toolbar追踪样式。很像 Firebug 。
编辑: 请注意,您必须在元素上设置宽度,否则 margin:0 auto 不会有任何效果。
关于css - Internet Explorer 中的背景对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6771710/