【问题标题】:Div's Margin does not work in Internet ExplorerDiv 的边距在 Internet Explorer 中不起作用
【发布时间】:2011-11-09 18:32:53
【问题描述】:

由于某种原因,我的内容区域的边距,150px 顶部在 Internet Explorer 中不起作用,因此内容位于标题下方。有什么帮助吗?我知道在 Internet Explorer 中一般固定有点奇怪,但奇怪的是这似乎有效,只是内容从页面顶部开始,而不是向下 150 像素。

    html {
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
overflow-x: auto;
}

body {
background-color: #FBFBFB;
margin:0; 
padding:0; 
}
#header {
position: fixed;
top: 0;
left: 0;
width: 100%; 
height: 150px;
background-color: #FBFBFB;
z-index: 100;
}

#sidebar {
position: fixed;
top: 150px;
left: 0;
width: 275px;
height: 100%;
z-index: 100;
}



#content {
width: 837px;
margin-top: 150px;
margin-left: 325px;
overflow: auto;
}

【问题讨论】:

  • 您能否发布您正在使用的 HTML,以便我们知道这些元素的放置位置?

标签: css internet-explorer margin fixed


【解决方案1】:

您有我们可以检查的链接吗?

改用“padding-top: 150px”,除非有什么东西阻止你这样做,否则这通常会奏效。否则,请尝试使用“zoom: 1”、“display: block”、“position: relative” 等常规技巧(如果适用)。

【讨论】:

  • 填充技巧奏效了,谢谢!如此简单,却又如此容易错过。
猜你喜欢
  • 2012-05-09
  • 2012-01-25
  • 2012-05-23
  • 2016-10-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-01-19
  • 1970-01-01
相关资源
最近更新 更多