【问题标题】:margin:0 auto is not working in internet explorer边距:0 自动在 Internet Explorer 中不起作用
【发布时间】:2012-05-09 22:53:24
【问题描述】:

margin:0 auto 在 Internet Explorer 中不起作用。在 Firefox 中运行良好。

请查看网站http://jobslanda.com/

#Body{
    background: none repeat scroll 0 0 #FFFFFF;
    margin:0 auto;
    min-height: 500px;
    padding: 23px 20px 10px;
    width: 1000px;
    background-color:#ffffff;   
}
#wrapper {
    background-color: #FBF8F4;
    border: medium none;
    margin: 0 auto;
    position: relative;

}

请帮我解决这个问题。

此致,

苏尼尔

【问题讨论】:

  • 它在 IE7+ 上工作正常我已经检查过确保你没有在怪癖模式下加载它。在 IE 中按 f12 执行一项操作,然后查看您的网站以哪种模式打开
  • 那么,您是指底部块中的偏移量还是其他什么?编辑:我看到没有一个块位于白色区域的中心。是这个问题吗?

标签: css internet-explorer css-float margin


【解决方案1】:

我假设您指的是您的第二条规则,#wrapper。自动边距仅在元素具有已知宽度时才起作用; #wrapper 目前是 width:auto,所以没有剩余的余量可以分配。

【讨论】:

  • 我已将包装器的宽度和高度更改为 100%。但问题依然存在。
猜你喜欢
  • 2010-10-14
  • 2011-11-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-04-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多