How to vertically center a div for all browsers?
问题 I want to center a div vertically with CSS. I don\'t want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support. <body> <div>Div to be aligned vertically</div> </body> How can I center a div vertically in all major browsers, including Internet Explorer 6? 回答1: Below is the best all-around solution I could build to vertically and horizontally center a fixed-width, flexible height content box. It was tested and working for