Published in: CSS
URL: http://stylizedweb.com/2008/02/01/vertical-align-div/
the best solution for vertical align
<div id=”shim”/></div> <div id=”wrapper”> Content </div> html, body { height: 100%; margin: 0; padding: 0; } * { margin:0px auto; padding:0; } div#shim { visibility: hidden; width: 100%; height: 50%; margin-top: -200px; float: left; } div#wrapper { width: 1000px; height: 400px; clear: both; background:red; position: relative; top: -200px; /* IE4ever Hack: Hide from IE4 **/ position: static; /** end hack */ } /* Hide from IE5mac \*//*/ div#shim { display: none; } html, body { height: auto; } /* end hack */ /* ]]> */
You need to login to post a comment.
