Return to Snippet

Revision: 5055
at February 8, 2008 06:46 by stylizedweb


Initial Code
<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 */

/* ]]> */

Initial URL
http://stylizedweb.com/2008/02/01/vertical-align-div/

Initial Description
the best solution for vertical align

Initial Title
Vertical align div

Initial Tags
css

Initial Language
CSS