css - Div 的边距在 Internet Explorer 中不起作用

标签 css internet-explorer margin fixed

出于某种原因,我的内容区域的边距 150px top 在 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;
}

最佳答案

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

尝试使用“padding-top: 150px”代替,除非有什么东西阻止你这样做,否则这基本上是有效的。否则,如果适用,请尝试使用“zoom: 1”、“display: block”、“position: relative”等常规技巧。

关于css - Div 的边距在 Internet Explorer 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7293954/

相关文章:

html - 垂直列表中 <li> 之间的 CSS3 背景图像

css - SCSS 和 Sass 有什么区别?

c# - Internet Explorer 在保存/打开文件时显示乱码?

javascript - IE8 和 7 上的权限被拒绝错误

css - 在 IE7 中没有边距

Jquery if 语句获取背景图像 css 值

html - CSS3 卷页阴影

javascript - IE9 : Object doesn't support the property "is"

css - 垂直文本对齐在移动设备上不起作用

javascript - 图像边距不变。可能是由于我的 javascript?