/ Published in: Other
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<div class="container"> <div class="cell"> <div class="content"> </div> </div> </div> .container { display: table; height: 100%; width: 100%; } .cell { display: table-cell; vertical-align: middle; /* For IE6/7 */ position: relative; top:expression(this.parentNode.clientHeight/2 - this.firstChild.clientHeight/2 + " px"); } .content { /* center horizontally */ margin: 0 auto; width: 400px; }