<style type= "Text/css" > #box {width:600px; height:400px; border:1px solid Red;} #box {position:static; *position:relative; display:table; *display:block;} #box-middle{position:static; *position:absolute; display:table-cell; *display:block; *top:50%; Vertical-align: Middle; *vertical-align:auto;} #box-inner{position:relative; top:-50%; background-color:blue; margin:0 auto; width:200px; height:100px;} </style> <div id= "box" > <div id= "box-middle" > <div id= "Box-inner" >content</div> </ Div> </div>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Finally saw this abnormal IE7, like the mist like rain and wind, ie series of CSS hack: * HTML it recognized, Firefox CSS hack:html>body, #id [id], Html[xmlns] Div Such dongdong it also recognized, Teach me how to say it's good!
Finally through the invincible * solved it!