I have the body element set to 840px and then margins auto:
body {
width: 840px;
margin: auto;
}
on FF, safari, and chrome this centers everything in the body of my site. However on IE (testing in IE9 currently) all of my divs that are set to 100% still expand to the whole width of the screen. In dev tools it still says that the body has width 840 but it does not constrict the rest of the elements.
What to do here?
IE doesn't support that ... To do such you can create a master "container" div for IE only and use an IE specific CSS file (that mozilla etc will ignore, so that div will have no bearing on your current design) to set the width of the DIV and to center it using
Include the IE only css like such
Limited, yes, but IE doesn't allow for body width to be set.
Use valid doctype like <!DOCTYPE HTML>