Div 的边距在 Internet Explorer 中不起作用
由于某种原因,我的内容区域的边距(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;
}
For some reason the margin of my content area, 150px top isn't working in internet explorer so that the content is going underneath the header. any help? I know generally fixed is a bit weird in internet explorer, but weirdly this seems to be working, it's just the content is starting off at the top of the page rather than 150px down.
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;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有我们可以检查的链接吗?
尝试使用“padding-top: 150px”,这通常是有效的,除非有什么东西阻止你这样做。否则,请尝试使用“zoom: 1”、“display: block”、“position:relative”等常规技巧(如果适用)。
Do you have a link that we can check?
Try "padding-top: 150px" instead, that mostly works unless there is something preventing you from doing that. Otherwise, try the regular tricks with "zoom: 1", "display: block", "position: relative" if they are applicable.