The problem, guys, is this: the 'margin auto'
CSS rule along with 'position absolute'
does not work in IE7. The problem is in IE7, in all other browsers everything works fine. I have a parent element with 'position relative'
, it contains a child with 'position absolute'
. I need to align the c 'position absolute'
element with respect to the left and right side of the parent element.
.header { width: 100%; min-width: 1000px; position: relative; height: 341px; } .block-up { width: 100%; min-width: 1000px; background: #da251c; height: 341px; } .block-down { width: 100%; min-width: 1000px; background: #585453; overflow: hidden; height: 341px; } /*problem areas*/ .header-content { background: #ffffff; position: absolute; width: 493px; top: 150px; left: 10px; right: 0; bottom: 0; margin: auto; height: 341px; } /*problem areas*/ .header-content-box { position: relative; width: 162px; float: left; border: 1px solid red; height: 341px; } <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <div class="header"> <div class="block-up"> </div> <div class="block-down"> </div> <div class="header-content"> <div class="header-content-box"> </div> <div class="header-content-box"> </div> <div class="header-content-box"> </div> </div> </div>