Search code examples
cssinternet-explorermarginfixed

Div's Margin does not work in Internet Explorer


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;
}

Solution

  • 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.